@roster-lock/match-agent 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/dist/assets/index-DeYshswm.js +125 -0
- package/client/dist/assets/index-gxAuIfGQ.css +1 -0
- package/client/dist/index.html +13 -0
- package/client/index.html +12 -0
- package/client/node_modules/.bin/terser +17 -0
- package/client/node_modules/.bin/tsc +17 -0
- package/client/node_modules/.bin/vite +17 -0
- package/client/node_modules/.vite/deps/@rjsf_core.js +6609 -0
- package/client/node_modules/.vite/deps/@rjsf_core.js.map +7 -0
- package/client/node_modules/.vite/deps/@rjsf_validator-ajv8.js +13 -0
- package/client/node_modules/.vite/deps/@rjsf_validator-ajv8.js.map +7 -0
- package/client/node_modules/.vite/deps/@roster-lock_ts-client.js +419 -0
- package/client/node_modules/.vite/deps/@roster-lock_ts-client.js.map +7 -0
- package/client/node_modules/.vite/deps/@roster-lock_types.js +5 -0
- package/client/node_modules/.vite/deps/@roster-lock_types.js.map +7 -0
- package/client/node_modules/.vite/deps/@roster-lock_utils.js +5 -0
- package/client/node_modules/.vite/deps/@roster-lock_utils.js.map +7 -0
- package/client/node_modules/.vite/deps/_metadata.json +97 -0
- package/client/node_modules/.vite/deps/chunk-4D2L7OBZ.js +16039 -0
- package/client/node_modules/.vite/deps/chunk-4D2L7OBZ.js.map +7 -0
- package/client/node_modules/.vite/deps/chunk-5KLROPUR.js +292 -0
- package/client/node_modules/.vite/deps/chunk-5KLROPUR.js.map +7 -0
- package/client/node_modules/.vite/deps/chunk-77TXW5ZT.js +280 -0
- package/client/node_modules/.vite/deps/chunk-77TXW5ZT.js.map +7 -0
- package/client/node_modules/.vite/deps/chunk-I55GDNGV.js +1004 -0
- package/client/node_modules/.vite/deps/chunk-I55GDNGV.js.map +7 -0
- package/client/node_modules/.vite/deps/chunk-IIDO6PKU.js +2337 -0
- package/client/node_modules/.vite/deps/chunk-IIDO6PKU.js.map +7 -0
- package/client/node_modules/.vite/deps/chunk-NE7PXY4V.js +466 -0
- package/client/node_modules/.vite/deps/chunk-NE7PXY4V.js.map +7 -0
- package/client/node_modules/.vite/deps/chunk-WMTNK64S.js +52 -0
- package/client/node_modules/.vite/deps/chunk-WMTNK64S.js.map +7 -0
- package/client/node_modules/.vite/deps/package.json +3 -0
- package/client/node_modules/.vite/deps/react-dom.js +6 -0
- package/client/node_modules/.vite/deps/react-dom.js.map +7 -0
- package/client/node_modules/.vite/deps/react-dom_client.js +20217 -0
- package/client/node_modules/.vite/deps/react-dom_client.js.map +7 -0
- package/client/node_modules/.vite/deps/react-router-dom.js +14702 -0
- package/client/node_modules/.vite/deps/react-router-dom.js.map +7 -0
- package/client/node_modules/.vite/deps/react.js +5 -0
- package/client/node_modules/.vite/deps/react.js.map +7 -0
- package/client/node_modules/.vite/deps/react_jsx-dev-runtime.js +278 -0
- package/client/node_modules/.vite/deps/react_jsx-dev-runtime.js.map +7 -0
- package/client/node_modules/.vite/deps/react_jsx-runtime.js +6 -0
- package/client/node_modules/.vite/deps/react_jsx-runtime.js.map +7 -0
- package/client/node_modules/.vite/deps_temp_ab51ebe9/package.json +3 -0
- package/client/package.json +30 -0
- package/client/src/App.tsx +56 -0
- package/client/src/NavBar.tsx +13 -0
- package/client/src/api/matchAgent.ts +159 -0
- package/client/src/bridge/hostBridge.ts +149 -0
- package/client/src/components/GameLauncherSettingsForm.tsx +140 -0
- package/client/src/components/InstallGameLauncherLightbox.tsx +31 -0
- package/client/src/components/Lightbox.tsx +15 -0
- package/client/src/components/RequireConnection.tsx +9 -0
- package/client/src/components/Selection/PieceCard.tsx +36 -0
- package/client/src/components/Selection/PieceTypeSection.tsx +112 -0
- package/client/src/components/Selection/PieceTypeTabs.tsx +31 -0
- package/client/src/components/Selection/PlayerSelectionPanel.tsx +40 -0
- package/client/src/components/Selection/index.tsx +147 -0
- package/client/src/components/Selection/selectionPlan.ts +75 -0
- package/client/src/context/DownloadSessionContext.tsx +48 -0
- package/client/src/context/IdentityContext.tsx +53 -0
- package/client/src/context/JoinSettingsContext.tsx +83 -0
- package/client/src/context/MatchAgentContext.tsx +85 -0
- package/client/src/hooks/useCursorInput.ts +55 -0
- package/client/src/hooks/useGamepads.ts +31 -0
- package/client/src/main.tsx +10 -0
- package/client/src/pages/Connect/index.tsx +46 -0
- package/client/src/pages/Download/index.tsx +175 -0
- package/client/src/pages/Game/index.tsx +65 -0
- package/client/src/pages/GameLauncher/Detail.tsx +12 -0
- package/client/src/pages/GameLauncher/index.tsx +32 -0
- package/client/src/pages/JoinSettings/index.tsx +58 -0
- package/client/src/pages/MatchMaking/index.tsx +190 -0
- package/client/src/styles/global.css +355 -0
- package/client/tsconfig.json +17 -0
- package/client/tsconfig.tsbuildinfo +1 -0
- package/client/vite.config.ts +33 -0
- package/dist/config/manage.js.map +1 -1
- package/dist/handle-room/version-1/game-launcher.js +181 -0
- package/dist/handle-room/version-1/game-launcher.js.map +1 -0
- package/dist/handle-room/version-1/index.js +15 -2
- package/dist/handle-room/version-1/index.js.map +1 -1
- package/dist/handle-room/version-1/piece-sort.js +1 -0
- package/dist/handle-room/version-1/piece-sort.js.map +1 -1
- package/dist/index.js +7 -4
- package/dist/index.js.map +1 -1
- package/dist/serve-client.js +88 -0
- package/dist/serve-client.js.map +1 -0
- package/dist/server.js +1 -1
- package/dist/server.js.map +1 -1
- package/package.json +12 -6
- package/src/config/manage.ts +5 -1
- package/src/handle-room/version-1/game-launcher.ts +263 -0
- package/src/handle-room/version-1/globals/types.ts +24 -0
- package/src/handle-room/version-1/index.ts +23 -3
- package/src/handle-room/version-1/piece-sort.ts +1 -1
- package/src/index.ts +25 -5
- package/src/serve-client.ts +100 -0
- package/src/server.ts +1 -1
- package/tests/integration/game-launcher-list.test.ts +77 -0
- package/tests/integration/game-launcher-settings.test.ts +138 -0
- package/tests/integration/game-launcher-start.test.ts +81 -0
- package/tests/integration/helpers/fakePluginRuntime.ts +26 -1
- package/tests/integration/helpers/server.ts +8 -2
- package/src/index.old.ts +0 -71
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../node_modules/.pnpm/fast-uri@4.1.2/node_modules/fast-uri/lib/utils.js", "../../../../../../node_modules/.pnpm/fast-uri@4.1.2/node_modules/fast-uri/lib/schemes.js", "../../../../../../node_modules/.pnpm/fast-uri@4.1.2/node_modules/fast-uri/index.js", "../../../../../../node_modules/.pnpm/jsonpointer@5.0.1/node_modules/jsonpointer/jsonpointer.js", "../../../../../../node_modules/.pnpm/react-is@18.3.1/node_modules/react-is/cjs/react-is.development.js", "../../../../../../node_modules/.pnpm/react-is@18.3.1/node_modules/react-is/index.js", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/compile/codegen/code.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/compile/codegen/scope.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/compile/codegen/index.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/compile/util.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/compile/names.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/compile/errors.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/compile/validate/boolSchema.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/compile/rules.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/compile/validate/applicability.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/compile/validate/dataType.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/compile/validate/defaults.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/vocabularies/code.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/compile/validate/keyword.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/compile/validate/subschema.ts", "../../../../../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js", "../../../../../../node_modules/.pnpm/json-schema-traverse@1.0.0/node_modules/json-schema-traverse/index.js", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/compile/resolve.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/compile/validate/index.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/runtime/validation_error.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/compile/ref_error.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/compile/index.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/data.json", "../../../../../../node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/lib/utils.js", "../../../../../../node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/lib/schemes.js", "../../../../../../node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/index.js", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/runtime/uri.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/core.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/vocabularies/core/id.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/vocabularies/core/ref.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/vocabularies/core/index.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/vocabularies/validation/limitNumber.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/vocabularies/validation/multipleOf.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/runtime/ucs2length.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/vocabularies/validation/limitLength.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/vocabularies/validation/pattern.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/vocabularies/validation/limitProperties.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/vocabularies/validation/required.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/vocabularies/validation/limitItems.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/runtime/equal.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/vocabularies/validation/uniqueItems.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/vocabularies/validation/const.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/vocabularies/validation/enum.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/vocabularies/validation/index.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/vocabularies/applicator/additionalItems.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/vocabularies/applicator/items.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/vocabularies/applicator/prefixItems.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/vocabularies/applicator/items2020.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/vocabularies/applicator/contains.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/vocabularies/applicator/dependencies.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/vocabularies/applicator/propertyNames.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/vocabularies/applicator/additionalProperties.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/vocabularies/applicator/properties.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/vocabularies/applicator/patternProperties.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/vocabularies/applicator/not.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/vocabularies/applicator/anyOf.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/vocabularies/applicator/oneOf.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/vocabularies/applicator/allOf.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/vocabularies/applicator/if.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/vocabularies/applicator/thenElse.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/vocabularies/applicator/index.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/vocabularies/format/format.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/vocabularies/format/index.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/vocabularies/metadata.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/vocabularies/draft7.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/vocabularies/discriminator/types.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/vocabularies/discriminator/index.ts", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-draft-07.json", "../../../../../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/lib/ajv.ts", "../../../../../../node_modules/.pnpm/ajv-formats@2.1.1_ajv@8.20.0/node_modules/ajv-formats/src/formats.ts", "../../../../../../node_modules/.pnpm/ajv-formats@2.1.1_ajv@8.20.0/node_modules/ajv-formats/src/limit.ts", "../../../../../../node_modules/.pnpm/ajv-formats@2.1.1_ajv@8.20.0/node_modules/ajv-formats/src/index.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/isObject.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/allowAdditionalItems.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/getDecimalSeparator.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/asNumber.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/constants.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/getUiOptions.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/canExpand.ts", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_root.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_overArg.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isPlainObject.js", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/createErrorHandler.ts", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isArray.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isSymbol.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isKey.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isObject.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/eq.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Map.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/memoize.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_memoizeCapped.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_stringToPath.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arrayMap.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseToString.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/toString.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_castPath.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_toKey.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseGet.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/get.js", "../../../../../../node_modules/.pnpm/fast-equals@6.0.2/node_modules/fast-equals/dist/es/index.mjs", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/deepEquals.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/findSchemaDefinition.ts", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_DataView.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Promise.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Set.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getTag.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isLength.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Stack.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arrayEach.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignValue.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_assignValue.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_copyObject.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/keys.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseAssign.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/keysIn.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignIn.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cloneBuffer.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arrayFilter.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/stubArray.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getSymbols.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_copySymbols.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getSymbolsIn.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_copySymbolsIn.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeys.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeysIn.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_initCloneArray.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cloneArrayBuffer.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cloneDataView.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cloneRegExp.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cloneSymbol.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cloneTypedArray.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_initCloneByTag.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMap.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isMap.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsSet.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isSet.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseClone.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/last.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseSlice.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_parent.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseUnset.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_customOmitClone.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isFlattenable.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseFlatten.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/flatten.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_apply.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_overRest.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/constant.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/identity.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseSetToString.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_shortOut.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_setToString.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_flatRest.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/omit.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseHas.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_hasPath.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/has.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isString.js", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/getDiscriminatorFieldFromSchema.ts", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/flattenDeep.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_assignMergeValue.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_createBaseFor.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseFor.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isArrayLikeObject.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_safeGet.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/toPlainObject.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseMergeDeep.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseMerge.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseRest.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isIterateeCall.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_createAssigner.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/merge.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseSet.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/set.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_castFunction.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_trimmedEndIndex.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseTrim.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/toNumber.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/toFinite.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/toInteger.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/times.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseForOwn.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_setCacheAdd.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_setCacheHas.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_SetCache.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arraySome.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cacheHas.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_equalArrays.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_mapToArray.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_setToArray.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_equalByTag.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_equalObjects.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqualDeep.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqual.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMatch.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isStrictComparable.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getMatchData.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_matchesStrictComparable.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseMatches.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseHasIn.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/hasIn.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseMatchesProperty.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseProperty.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_basePropertyDeep.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/property.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIteratee.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/transform.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseFindIndex.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNaN.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_strictIndexOf.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIndexOf.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arrayIncludes.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arrayIncludesWith.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/noop.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_createSet.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseUniq.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/uniq.js", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/guessType.ts", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/union.js", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/getSchemaType.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/mergeSchemas.ts", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isNumber.js", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/getOptionMatchingSimpleDiscriminator.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/schema/getFirstMatchingOption.ts", "../../../../../../node_modules/.pnpm/@x0k+json-schema-merge@1.0.4/node_modules/@x0k/json-schema-merge/src/lib/object.ts", "../../../../../../node_modules/.pnpm/@x0k+json-schema-merge@1.0.4/node_modules/@x0k/json-schema-merge/src/lib/json-schema/json-schema.ts", "../../../../../../node_modules/.pnpm/@x0k+json-schema-merge@1.0.4/node_modules/@x0k/json-schema-merge/src/lib/ord.ts", "../../../../../../node_modules/.pnpm/@x0k+json-schema-merge@1.0.4/node_modules/@x0k/json-schema-merge/src/lib/array.ts", "../../../../../../node_modules/.pnpm/@x0k+json-schema-merge@1.0.4/node_modules/@x0k/json-schema-merge/src/lib/memoize.ts", "../../../../../../node_modules/.pnpm/@x0k+json-schema-merge@1.0.4/node_modules/@x0k/json-schema-merge/src/lib/json-schema/compare/compare.ts", "../../../../../../node_modules/.pnpm/@x0k+json-schema-merge@1.0.4/node_modules/@x0k/json-schema-merge/src/lib/function.ts", "../../../../../../node_modules/.pnpm/@x0k+json-schema-merge@1.0.4/node_modules/@x0k/json-schema-merge/src/lib/math.ts", "../../../../../../node_modules/.pnpm/@x0k+json-schema-merge@1.0.4/node_modules/@x0k/json-schema-merge/src/lib/json-schema/merge/patterns.ts", "../../../../../../node_modules/.pnpm/@x0k+json-schema-merge@1.0.4/node_modules/@x0k/json-schema-merge/src/lib/json-schema/merge/merge.ts", "../../../../../../node_modules/.pnpm/@x0k+json-schema-merge@1.0.4/node_modules/@x0k/json-schema-merge/src/lib/json-schema/merge/all-of-merge.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/schema/shallowAllOfMerge.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/schema/retrieveSchema.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/schema/findSelectedOptionInXxxOf.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/schema/getFromSchema.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/schema/findFieldInSchema.ts", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arrayReduce.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_createBaseEach.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseEach.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseReduce.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/reduce.js", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/schema/getClosestMatchingOption.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/constIsAjvDataReference.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/isConstant.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/isFixedItems.ts", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isNil.js", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/mergeDefaultsWithFormData.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/mergeObjects.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/toConstant.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/optionsList.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/schema/isSelect.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/schema/isMultiSelect.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/schema/getDefaultFormState.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/isCustomWidget.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/schema/isFilesArray.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/schema/getDisplayLabel.ts", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_basePickBy.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_basePick.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/pick.js", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/schema/omitExtraData.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/schema/sanitizeDataForNewSchema.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/schema/toPathSchema.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/createSchemaUtils.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/dataURItoBlob.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/pad.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/dateRangeOptions.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/replaceStringParameters.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/englishStringTranslator.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/enumOptionsValueForIndex.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/enumOptionsDeselectValue.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/enumOptionsIsSelected.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/enumOptionsIndexForValue.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/enumOptionSelectedValue.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/enumOptionsSelectValue.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/enumOptionValueDecoder.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/enumOptionValueEncoder.ts", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/setWith.js", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/ErrorSchemaBuilder.ts", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseDifference.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/difference.js", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/pickBy.js", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/getChangedFields.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/getDateElementProps.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/rangeSpec.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/getInputProps.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/getOptionValueFormat.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/getSubmitButtonOptions.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/getTemplate.ts", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/uniqueId.js", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/getTestIds.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/getWidget.tsx", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/hashForSchema.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/hasWidget.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/idGenerators.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/isFormDataAvailable.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/isRootSchema.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/labelValue.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/localToUTC.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/logUnsupportedDefaultForEnum.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/lookupFromFormContext.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/orderProperties.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/parseDateString.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/resolveUiSchema.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/schemaRequiresTrueValue.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/SelectedOptionDescription.tsx", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/shallowEquals.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/shouldRender.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/shouldRenderOptionalField.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/toDateString.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/toErrorList.ts", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/toPath.js", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/toErrorSchema.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/toFieldPathId.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/unwrapErrorHandler.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/useAltDateWidgetProps.tsx", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/useDeepCompareMemo.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/useFileWidgetProps.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/utcToLocal.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/validationDataMerge.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/withIdRefPrefix.ts", "../../../../../../node_modules/.pnpm/@rjsf+utils@6.8.0_react@19.2.7/node_modules/@rjsf/utils/src/enums.ts", "../../../../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/forEach.js", "../../../../../../node_modules/.pnpm/@rjsf+validator-ajv8@6.8.0_@rjsf+utils@6.8.0_react@19.2.7_/node_modules/@rjsf/validator-ajv8/src/processRawValidationErrors.ts", "../../../../../../node_modules/.pnpm/@rjsf+validator-ajv8@6.8.0_@rjsf+utils@6.8.0_react@19.2.7_/node_modules/@rjsf/validator-ajv8/src/precompiledValidator.ts", "../../../../../../node_modules/.pnpm/@rjsf+validator-ajv8@6.8.0_@rjsf+utils@6.8.0_react@19.2.7_/node_modules/@rjsf/validator-ajv8/src/createPrecompiledValidator.ts", "../../../../../../node_modules/.pnpm/@rjsf+validator-ajv8@6.8.0_@rjsf+utils@6.8.0_react@19.2.7_/node_modules/@rjsf/validator-ajv8/src/createAjvInstance.ts", "../../../../../../node_modules/.pnpm/@rjsf+validator-ajv8@6.8.0_@rjsf+utils@6.8.0_react@19.2.7_/node_modules/@rjsf/validator-ajv8/src/validator.ts", "../../../../../../node_modules/.pnpm/@rjsf+validator-ajv8@6.8.0_@rjsf+utils@6.8.0_react@19.2.7_/node_modules/@rjsf/validator-ajv8/src/customizeValidator.ts", "../../../../../../node_modules/.pnpm/@rjsf+validator-ajv8@6.8.0_@rjsf+utils@6.8.0_react@19.2.7_/node_modules/@rjsf/validator-ajv8/src/index.ts"],
|
|
4
|
+
"sourcesContent": ["'use strict'\n\n/** @type {(value: string) => boolean} */\nconst isUUID = RegExp.prototype.test.bind(/^[\\da-f]{8}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{12}$/iu)\n\n/** @type {(value: string) => boolean} */\nconst isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)$/u)\n\n/** @type {(value: string) => boolean} */\nconst isHexPair = RegExp.prototype.test.bind(/^[\\da-f]{2}$/iu)\n\n/** @type {(value: string) => boolean} */\nconst isUnreserved = RegExp.prototype.test.bind(/^[\\da-z\\-._~]$/iu)\n\n/** @type {(value: string) => boolean} */\nconst isPathCharacter = RegExp.prototype.test.bind(/^[\\da-z\\-._~!$&'()*+,;=:@/]$/iu)\n\n/** @type {(value: string) => boolean} */\nconst isQueryFragmentCharacter = RegExp.prototype.test.bind(/^[\\da-z\\-._~!$&'()*+,;=:@/?]$/iu)\n\n/**\n * @param {Array<string>} input\n * @returns {string}\n */\nfunction stringArrayToHexStripped (input) {\n let acc = ''\n let code = 0\n let i = 0\n\n for (i = 0; i < input.length; i++) {\n code = input[i].charCodeAt(0)\n if (code === 48) {\n continue\n }\n if (!((code >= 48 && code <= 57) || (code >= 65 && code <= 70) || (code >= 97 && code <= 102))) {\n return ''\n }\n acc += input[i]\n break\n }\n\n for (i += 1; i < input.length; i++) {\n code = input[i].charCodeAt(0)\n if (!((code >= 48 && code <= 57) || (code >= 65 && code <= 70) || (code >= 97 && code <= 102))) {\n return ''\n }\n acc += input[i]\n }\n return acc\n}\n\n/**\n * @typedef {Object} GetIPV6Result\n * @property {boolean} error - Indicates if there was an error parsing the IPv6 address.\n * @property {string} address - The parsed IPv6 address.\n * @property {string} [zone] - The zone identifier, if present.\n */\n\n/**\n * @param {string} value\n * @returns {boolean}\n */\nconst nonSimpleDomain = RegExp.prototype.test.bind(/[^!\"$&'()*+,\\-.;=_`a-z{}~]/u)\n\n/**\n * @param {Array<string>} buffer\n * @returns {boolean}\n */\nfunction consumeIsZone (buffer) {\n buffer.length = 0\n return true\n}\n\n/**\n * @param {Array<string>} buffer\n * @param {Array<string>} address\n * @param {GetIPV6Result} output\n * @returns {boolean}\n */\nfunction consumeHextets (buffer, address, output) {\n if (buffer.length) {\n const hex = stringArrayToHexStripped(buffer)\n if (hex !== '') {\n address.push(hex)\n } else {\n output.error = true\n return false\n }\n buffer.length = 0\n }\n return true\n}\n\n/**\n * @param {string} input\n * @returns {GetIPV6Result}\n */\nfunction getIPV6 (input) {\n let tokenCount = 0\n const output = { error: false, address: '', zone: '' }\n /** @type {Array<string>} */\n const address = []\n /** @type {Array<string>} */\n const buffer = []\n let endipv6Encountered = false\n let endIpv6 = false\n\n let consume = consumeHextets\n\n for (let i = 0; i < input.length; i++) {\n const cursor = input[i]\n if (cursor === '[' || cursor === ']') { continue }\n if (cursor === ':') {\n if (endipv6Encountered === true) {\n endIpv6 = true\n }\n if (!consume(buffer, address, output)) { break }\n if (++tokenCount > 7) {\n // not valid\n output.error = true\n break\n }\n if (i > 0 && input[i - 1] === ':') {\n endipv6Encountered = true\n }\n address.push(':')\n continue\n } else if (cursor === '%') {\n if (!consume(buffer, address, output)) { break }\n // switch to zone detection\n consume = consumeIsZone\n } else {\n buffer.push(cursor)\n continue\n }\n }\n if (buffer.length) {\n if (consume === consumeIsZone) {\n output.zone = buffer.join('')\n } else if (endIpv6) {\n address.push(buffer.join(''))\n } else {\n address.push(stringArrayToHexStripped(buffer))\n }\n }\n output.address = address.join('')\n return output\n}\n\n/**\n * @typedef {Object} NormalizeIPv6Result\n * @property {string} host - The normalized host.\n * @property {string} [escapedHost] - The escaped host.\n * @property {boolean} isIPV6 - Indicates if the host is an IPv6 address.\n */\n\n/**\n * @param {string} host\n * @returns {NormalizeIPv6Result}\n */\nfunction normalizeIPv6 (host) {\n if (findToken(host, ':') < 2) { return { host, isIPV6: false } }\n const ipv6 = getIPV6(host)\n\n if (!ipv6.error) {\n let newHost = ipv6.address\n let escapedHost = ipv6.address\n if (ipv6.zone) {\n newHost += '%' + ipv6.zone\n escapedHost += '%25' + ipv6.zone\n }\n return { host: newHost, isIPV6: true, escapedHost }\n } else {\n return { host, isIPV6: false }\n }\n}\n\n/**\n * @param {string} str\n * @param {string} token\n * @returns {number}\n */\nfunction findToken (str, token) {\n let ind = 0\n for (let i = 0; i < str.length; i++) {\n if (str[i] === token) ind++\n }\n return ind\n}\n\n/**\n * @param {string} path\n * @returns {string}\n *\n * @see https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4\n */\nfunction removeDotSegments (path) {\n let input = path\n const output = []\n let nextSlash = -1\n let len = 0\n\n // eslint-disable-next-line no-cond-assign\n while (len = input.length) {\n if (len === 1) {\n if (input === '.') {\n break\n } else if (input === '/') {\n output.push('/')\n break\n } else {\n output.push(input)\n break\n }\n } else if (len === 2) {\n if (input[0] === '.') {\n if (input[1] === '.') {\n break\n } else if (input[1] === '/') {\n input = input.slice(2)\n continue\n }\n } else if (input[0] === '/') {\n if (input[1] === '.') {\n output.push('/')\n break\n }\n }\n } else if (len === 3) {\n if (input === '/..') {\n if (output.length !== 0) {\n output.pop()\n }\n output.push('/')\n break\n }\n }\n if (input[0] === '.') {\n if (input[1] === '.') {\n if (input[2] === '/') {\n input = input.slice(3)\n continue\n }\n } else if (input[1] === '/') {\n input = input.slice(2)\n continue\n }\n } else if (input[0] === '/') {\n if (input[1] === '.') {\n if (input[2] === '/') {\n input = input.slice(2)\n continue\n } else if (input[2] === '.') {\n if (input[3] === '/') {\n input = input.slice(3)\n if (output.length !== 0) {\n output.pop()\n }\n continue\n }\n }\n }\n }\n\n // Rule 2E: Move normal path segment to output\n if ((nextSlash = input.indexOf('/', 1)) === -1) {\n output.push(input)\n break\n } else {\n output.push(input.slice(0, nextSlash))\n input = input.slice(nextSlash)\n }\n }\n\n return output.join('')\n}\n\n/**\n * Re-escape RFC 3986 gen-delims that must not appear literally in the host.\n * After the URI regex parses, these characters cannot be literal in the host\n * field, so any that appear after decoding came from percent-encoding and\n * must be restored to prevent authority structure changes.\n *\n * @param {string} host\n * @param {boolean} isIP - true for IPv4/IPv6 hosts (skip colon re-escaping)\n * @returns {string}\n */\nconst HOST_DELIMS = { '@': '%40', '/': '%2F', '?': '%3F', '#': '%23', ':': '%3A' }\nconst HOST_DELIM_RE = /[@/?#:]/g\nconst HOST_DELIM_NO_COLON_RE = /[@/?#]/g\n\nfunction reescapeHostDelimiters (host, isIP) {\n const re = isIP ? HOST_DELIM_NO_COLON_RE : HOST_DELIM_RE\n re.lastIndex = 0\n return host.replace(re, (ch) => HOST_DELIMS[ch])\n}\n\n/**\n * Normalizes percent escapes and optionally decodes only unreserved ASCII bytes.\n * Reserved delimiters such as `%2F` and `%2E` stay escaped.\n *\n * @param {string} input\n * @param {boolean} [decodeUnreserved=false]\n * @returns {string}\n */\nfunction normalizePercentEncoding (input, decodeUnreserved = false) {\n if (input.indexOf('%') === -1) {\n return input\n }\n\n let output = ''\n\n for (let i = 0; i < input.length; i++) {\n if (input[i] === '%' && i + 2 < input.length) {\n const hex = input.slice(i + 1, i + 3)\n if (isHexPair(hex)) {\n const normalizedHex = hex.toUpperCase()\n const decoded = String.fromCharCode(parseInt(normalizedHex, 16))\n\n if (decodeUnreserved && isUnreserved(decoded)) {\n output += decoded\n } else {\n output += '%' + normalizedHex\n }\n\n i += 2\n continue\n }\n }\n\n output += input[i]\n }\n\n return output\n}\n\n/** Pre-built `%XX` strings for every byte. Avoids per-call hex math/concat. */\nconst BYTE_HEX = new Array(256)\n{\n const HEX_DIGITS = '0123456789ABCDEF'\n for (let i = 0; i < 256; i++) {\n BYTE_HEX[i] = '%' + HEX_DIGITS[i >> 4] + HEX_DIGITS[i & 0xF]\n }\n}\n\n/**\n * Mirrors the pass-through set of the deprecated `escape()` global:\n * `A-Z a-z 0-9 * + - . / @ _`. Keeps drop-in semantics for ASCII input.\n *\n * @param {number} cp\n * @returns {boolean}\n */\nfunction isEscapeSafe (cp) {\n return (\n (cp >= 0x30 && cp <= 0x39) ||\n (cp >= 0x41 && cp <= 0x5A) ||\n (cp >= 0x61 && cp <= 0x7A) ||\n cp === 0x2A || cp === 0x2B || cp === 0x2D || cp === 0x2E ||\n cp === 0x2F || cp === 0x40 || cp === 0x5F\n )\n}\n\n/**\n * RFC 3986 percent-encode a non-ASCII Unicode code point as UTF-8 bytes.\n * Caller handles the ASCII branch inline for speed.\n *\n * @param {number} cp - Unicode code point (>= 0x80, <= 0x10FFFF)\n * @returns {string}\n */\nfunction percentEncodeNonAscii (cp) {\n if (cp < 0x800) {\n return BYTE_HEX[0xC0 | (cp >> 6)] +\n BYTE_HEX[0x80 | (cp & 0x3F)]\n }\n if (cp < 0x10000) {\n return BYTE_HEX[0xE0 | (cp >> 12)] +\n BYTE_HEX[0x80 | ((cp >> 6) & 0x3F)] +\n BYTE_HEX[0x80 | (cp & 0x3F)]\n }\n return BYTE_HEX[0xF0 | (cp >> 18)] +\n BYTE_HEX[0x80 | ((cp >> 12) & 0x3F)] +\n BYTE_HEX[0x80 | ((cp >> 6) & 0x3F)] +\n BYTE_HEX[0x80 | (cp & 0x3F)]\n}\n\n/**\n * Normalizes path data without turning reserved escapes into live path syntax.\n * Valid escapes are uppercased, raw unsafe characters are escaped, and only\n * unreserved bytes that are not `.` are decoded.\n *\n * @param {string} input\n * @returns {string}\n */\nfunction normalizePathEncoding (input) {\n let output = ''\n\n for (let i = 0; i < input.length; i++) {\n const ch = input[i]\n if (ch === '%' && i + 2 < input.length) {\n const hex = input.slice(i + 1, i + 3)\n if (isHexPair(hex)) {\n const normalizedHex = hex.toUpperCase()\n const decoded = String.fromCharCode(parseInt(normalizedHex, 16))\n\n if (decoded !== '.' && isUnreserved(decoded)) {\n output += decoded\n } else {\n output += '%' + normalizedHex\n }\n\n i += 2\n continue\n }\n }\n\n if (isPathCharacter(ch)) {\n output += ch\n } else {\n const code = input.charCodeAt(i)\n if (code < 0x80) {\n output += isEscapeSafe(code) ? ch : BYTE_HEX[code]\n } else if (code < 0xD800 || code > 0xDFFF) {\n output += percentEncodeNonAscii(code)\n } else if (code <= 0xDBFF && i + 1 < input.length) {\n const low = input.charCodeAt(i + 1)\n if (low >= 0xDC00 && low <= 0xDFFF) {\n output += percentEncodeNonAscii(0x10000 + ((code - 0xD800) << 10) + (low - 0xDC00))\n i++\n } else {\n output += percentEncodeNonAscii(0xFFFD)\n }\n } else {\n output += percentEncodeNonAscii(0xFFFD)\n }\n }\n }\n\n return output\n}\n\n/**\n * Normalizes the percent-encoding of a query or fragment component.\n *\n * Like `normalizePathEncoding`, but uses the query/fragment character set\n * (which additionally allows `?`) and decodes `.` since it has no dot-segment\n * meaning outside of a path.\n *\n * @param {string} input\n * @returns {string}\n */\nfunction normalizeQueryFragmentEncoding (input) {\n let output = ''\n\n for (let i = 0; i < input.length; i++) {\n const ch = input[i]\n if (ch === '%' && i + 2 < input.length) {\n const hex = input.slice(i + 1, i + 3)\n if (isHexPair(hex)) {\n const normalizedHex = hex.toUpperCase()\n const decoded = String.fromCharCode(parseInt(normalizedHex, 16))\n\n if (isUnreserved(decoded)) {\n output += decoded\n } else {\n output += '%' + normalizedHex\n }\n\n i += 2\n continue\n }\n }\n\n if (isQueryFragmentCharacter(ch)) {\n output += ch\n } else {\n const code = input.charCodeAt(i)\n if (code < 0x80) {\n output += isEscapeSafe(code) ? ch : BYTE_HEX[code]\n } else if (code < 0xD800 || code > 0xDFFF) {\n output += percentEncodeNonAscii(code)\n } else if (code <= 0xDBFF && i + 1 < input.length) {\n const low = input.charCodeAt(i + 1)\n if (low >= 0xDC00 && low <= 0xDFFF) {\n output += percentEncodeNonAscii(0x10000 + ((code - 0xD800) << 10) + (low - 0xDC00))\n i++\n } else {\n output += percentEncodeNonAscii(0xFFFD)\n }\n } else {\n output += percentEncodeNonAscii(0xFFFD)\n }\n }\n }\n\n return output\n}\n\n/**\n * Escapes a component while preserving existing valid percent escapes.\n *\n * @param {string} input\n * @returns {string}\n */\nfunction escapePreservingEscapes (input) {\n let output = ''\n\n for (let i = 0; i < input.length; i++) {\n const ch = input[i]\n if (ch === '%' && i + 2 < input.length) {\n const hex = input.slice(i + 1, i + 3)\n if (isHexPair(hex)) {\n output += '%' + hex.toUpperCase()\n i += 2\n continue\n }\n }\n\n const code = input.charCodeAt(i)\n if (code < 0x80) {\n output += isEscapeSafe(code) ? ch : BYTE_HEX[code]\n } else if (code < 0xD800 || code > 0xDFFF) {\n output += percentEncodeNonAscii(code)\n } else if (code <= 0xDBFF && i + 1 < input.length) {\n const low = input.charCodeAt(i + 1)\n if (low >= 0xDC00 && low <= 0xDFFF) {\n output += percentEncodeNonAscii(0x10000 + ((code - 0xD800) << 10) + (low - 0xDC00))\n i++\n } else {\n output += percentEncodeNonAscii(0xFFFD)\n }\n } else {\n output += percentEncodeNonAscii(0xFFFD)\n }\n }\n\n return output\n}\n\n/**\n * @param {import('../types/index').URIComponent} component\n * @returns {string|undefined}\n */\nfunction recomposeAuthority (component) {\n const uriTokens = []\n\n if (component.userinfo !== undefined) {\n uriTokens.push(component.userinfo)\n uriTokens.push('@')\n }\n\n if (component.host !== undefined) {\n let host = unescape(component.host)\n if (!isIPv4(host)) {\n const ipV6res = normalizeIPv6(host)\n if (ipV6res.isIPV6 === true) {\n host = `[${ipV6res.escapedHost}]`\n } else {\n host = reescapeHostDelimiters(host, false)\n }\n }\n uriTokens.push(host)\n }\n\n if (typeof component.port === 'number' || typeof component.port === 'string') {\n uriTokens.push(':')\n uriTokens.push(String(component.port))\n }\n\n return uriTokens.length ? uriTokens.join('') : undefined\n};\n\nmodule.exports = {\n nonSimpleDomain,\n recomposeAuthority,\n reescapeHostDelimiters,\n normalizePercentEncoding,\n normalizePathEncoding,\n normalizeQueryFragmentEncoding,\n escapePreservingEscapes,\n removeDotSegments,\n isIPv4,\n isUUID,\n normalizeIPv6,\n stringArrayToHexStripped\n}\n", "'use strict'\n\nconst { isUUID } = require('./utils')\nconst URN_REG = /([\\da-z][\\d\\-a-z]{0,31}):((?:[\\w!$'()*+,\\-.:;=@]|%[\\da-f]{2})+)/iu\n\nconst supportedSchemeNames = /** @type {const} */ (['http', 'https', 'ws',\n 'wss', 'urn', 'urn:uuid'])\n\n/** @typedef {supportedSchemeNames[number]} SchemeName */\n\n/**\n * @param {string} name\n * @returns {name is SchemeName}\n */\nfunction isValidSchemeName (name) {\n return supportedSchemeNames.indexOf(/** @type {*} */ (name)) !== -1\n}\n\n/**\n * @callback SchemeFn\n * @param {import('../types/index').URIComponent} component\n * @param {import('../types/index').Options} options\n * @returns {import('../types/index').URIComponent}\n */\n\n/**\n * @typedef {Object} SchemeHandler\n * @property {SchemeName} scheme - The scheme name.\n * @property {boolean} [domainHost] - Indicates if the scheme supports domain hosts.\n * @property {SchemeFn} parse - Function to parse the URI component for this scheme.\n * @property {SchemeFn} serialize - Function to serialize the URI component for this scheme.\n * @property {boolean} [skipNormalize] - Indicates if normalization should be skipped for this scheme.\n * @property {boolean} [absolutePath] - Indicates if the scheme uses absolute paths.\n * @property {boolean} [unicodeSupport] - Indicates if the scheme supports Unicode.\n */\n\n/**\n * @param {import('../types/index').URIComponent} wsComponent\n * @returns {boolean}\n */\nfunction wsIsSecure (wsComponent) {\n if (wsComponent.secure === true) {\n return true\n } else if (wsComponent.secure === false) {\n return false\n } else if (wsComponent.scheme) {\n return (\n wsComponent.scheme.length === 3 &&\n (wsComponent.scheme[0] === 'w' || wsComponent.scheme[0] === 'W') &&\n (wsComponent.scheme[1] === 's' || wsComponent.scheme[1] === 'S') &&\n (wsComponent.scheme[2] === 's' || wsComponent.scheme[2] === 'S')\n )\n } else {\n return false\n }\n}\n\n/** @type {SchemeFn} */\nfunction httpParse (component) {\n if (!component.host) {\n component.error = component.error || 'HTTP URIs must have a host.'\n }\n\n return component\n}\n\n/** @type {SchemeFn} */\nfunction httpSerialize (component) {\n const secure = String(component.scheme).toLowerCase() === 'https'\n\n // normalize the default port\n if (component.port === (secure ? 443 : 80) || component.port === '') {\n component.port = undefined\n }\n\n // normalize the empty path\n if (!component.path) {\n component.path = '/'\n }\n\n // NOTE: We do not parse query strings for HTTP URIs\n // as WWW Form Url Encoded query strings are part of the HTML4+ spec,\n // and not the HTTP spec.\n\n return component\n}\n\n/** @type {SchemeFn} */\nfunction wsParse (wsComponent) {\n// indicate if the secure flag is set\n wsComponent.secure = wsIsSecure(wsComponent)\n\n // construct resouce name\n wsComponent.resourceName = (wsComponent.path || '/') + (wsComponent.query ? '?' + wsComponent.query : '')\n wsComponent.path = undefined\n wsComponent.query = undefined\n\n return wsComponent\n}\n\n/** @type {SchemeFn} */\nfunction wsSerialize (wsComponent) {\n// normalize the default port\n if (wsComponent.port === (wsIsSecure(wsComponent) ? 443 : 80) || wsComponent.port === '') {\n wsComponent.port = undefined\n }\n\n // ensure scheme matches secure flag\n if (typeof wsComponent.secure === 'boolean') {\n wsComponent.scheme = (wsComponent.secure ? 'wss' : 'ws')\n wsComponent.secure = undefined\n }\n\n // reconstruct path from resource name\n if (wsComponent.resourceName) {\n const [path, query] = wsComponent.resourceName.split('?')\n wsComponent.path = (path && path !== '/' ? path : undefined)\n wsComponent.query = query\n wsComponent.resourceName = undefined\n }\n\n // forbid fragment component\n wsComponent.fragment = undefined\n\n return wsComponent\n}\n\n/** @type {SchemeFn} */\nfunction urnParse (urnComponent, options) {\n if (!urnComponent.path) {\n urnComponent.error = 'URN can not be parsed'\n return urnComponent\n }\n const matches = urnComponent.path.match(URN_REG)\n if (matches) {\n const scheme = options.scheme || urnComponent.scheme || 'urn'\n urnComponent.nid = matches[1].toLowerCase()\n urnComponent.nss = matches[2]\n const urnScheme = `${scheme}:${options.nid || urnComponent.nid}`\n const schemeHandler = getSchemeHandler(urnScheme)\n urnComponent.path = undefined\n\n if (schemeHandler) {\n urnComponent = schemeHandler.parse(urnComponent, options)\n }\n } else {\n urnComponent.error = urnComponent.error || 'URN can not be parsed.'\n }\n\n return urnComponent\n}\n\n/** @type {SchemeFn} */\nfunction urnSerialize (urnComponent, options) {\n if (urnComponent.nid === undefined) {\n throw new Error('URN without nid cannot be serialized')\n }\n const scheme = options.scheme || urnComponent.scheme || 'urn'\n const nid = urnComponent.nid.toLowerCase()\n const urnScheme = `${scheme}:${options.nid || nid}`\n const schemeHandler = getSchemeHandler(urnScheme)\n\n if (schemeHandler) {\n urnComponent = schemeHandler.serialize(urnComponent, options)\n }\n\n const uriComponent = urnComponent\n const nss = urnComponent.nss\n uriComponent.path = `${nid || options.nid}:${nss}`\n\n options.skipEscape = true\n return uriComponent\n}\n\n/** @type {SchemeFn} */\nfunction urnuuidParse (urnComponent, options) {\n const uuidComponent = urnComponent\n uuidComponent.uuid = uuidComponent.nss\n uuidComponent.nss = undefined\n\n if (!options.tolerant && (!uuidComponent.uuid || !isUUID(uuidComponent.uuid))) {\n uuidComponent.error = uuidComponent.error || 'UUID is not valid.'\n }\n\n return uuidComponent\n}\n\n/** @type {SchemeFn} */\nfunction urnuuidSerialize (uuidComponent) {\n const urnComponent = uuidComponent\n // normalize UUID\n urnComponent.nss = (uuidComponent.uuid || '').toLowerCase()\n return urnComponent\n}\n\nconst http = /** @type {SchemeHandler} */ ({\n scheme: 'http',\n domainHost: true,\n parse: httpParse,\n serialize: httpSerialize\n})\n\nconst https = /** @type {SchemeHandler} */ ({\n scheme: 'https',\n domainHost: http.domainHost,\n parse: httpParse,\n serialize: httpSerialize\n})\n\nconst ws = /** @type {SchemeHandler} */ ({\n scheme: 'ws',\n domainHost: true,\n parse: wsParse,\n serialize: wsSerialize\n})\n\nconst wss = /** @type {SchemeHandler} */ ({\n scheme: 'wss',\n domainHost: ws.domainHost,\n parse: ws.parse,\n serialize: ws.serialize\n})\n\nconst urn = /** @type {SchemeHandler} */ ({\n scheme: 'urn',\n parse: urnParse,\n serialize: urnSerialize,\n skipNormalize: true\n})\n\nconst urnuuid = /** @type {SchemeHandler} */ ({\n scheme: 'urn:uuid',\n parse: urnuuidParse,\n serialize: urnuuidSerialize,\n skipNormalize: true\n})\n\nconst SCHEMES = /** @type {Record<SchemeName, SchemeHandler>} */ ({\n http,\n https,\n ws,\n wss,\n urn,\n 'urn:uuid': urnuuid\n})\n\nObject.setPrototypeOf(SCHEMES, null)\n\n/**\n * @param {string|undefined} scheme\n * @returns {SchemeHandler|undefined}\n */\nfunction getSchemeHandler (scheme) {\n return (\n scheme && (\n SCHEMES[/** @type {SchemeName} */ (scheme)] ||\n SCHEMES[/** @type {SchemeName} */(scheme.toLowerCase())])\n ) ||\n undefined\n}\n\nmodule.exports = {\n wsIsSecure,\n SCHEMES,\n isValidSchemeName,\n getSchemeHandler,\n}\n", "'use strict'\n\nconst { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, normalizeQueryFragmentEncoding, escapePreservingEscapes, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require('./lib/utils')\nconst { SCHEMES, getSchemeHandler } = require('./lib/schemes')\n\n/**\n * @template {import('./types/index').URIComponent|string} T\n * @param {T} uri\n * @param {import('./types/index').Options} [options]\n * @returns {T}\n */\nfunction normalize (uri, options) {\n if (typeof uri === 'string') {\n uri = /** @type {T} */ (normalizeString(uri, options))\n } else if (typeof uri === 'object') {\n uri = /** @type {T} */ (parse(serialize(uri, options), options))\n }\n return uri\n}\n\n/**\n * @param {string} baseURI\n * @param {string} relativeURI\n * @param {import('./types/index').Options} [options]\n * @returns {string}\n */\nfunction resolve (baseURI, relativeURI, options) {\n const schemelessOptions = options ? Object.assign({ scheme: 'null' }, options) : { scheme: 'null' }\n const { parsed: baseParsed, malformedAuthorityOrPort: baseMalformed } = parseWithStatus(baseURI, schemelessOptions)\n const { parsed: relativeParsed, malformedAuthorityOrPort: relativeMalformed } = parseWithStatus(relativeURI, schemelessOptions)\n if (baseMalformed || relativeMalformed) {\n throw new Error(baseParsed.error || relativeParsed.error || 'URI is malformed.')\n }\n const resolved = resolveComponent(baseParsed, relativeParsed, schemelessOptions, true)\n schemelessOptions.skipEscape = true\n return serialize(resolved, schemelessOptions)\n}\n\n/**\n * @param {import ('./types/index').URIComponent} base\n * @param {import ('./types/index').URIComponent} relative\n * @param {import('./types/index').Options} [options]\n * @param {boolean} [skipNormalization=false]\n * @returns {import ('./types/index').URIComponent}\n */\nfunction resolveComponent (base, relative, options, skipNormalization) {\n /** @type {import('./types/index').URIComponent} */\n const target = {}\n if (!skipNormalization) {\n base = parse(serialize(base, options), options) // normalize base component\n relative = parse(serialize(relative, options), options) // normalize relative component\n }\n options = options || {}\n\n if (!options.tolerant && relative.scheme) {\n target.scheme = relative.scheme\n // target.authority = relative.authority;\n target.userinfo = relative.userinfo\n target.host = relative.host\n target.port = relative.port\n target.path = removeDotSegments(relative.path || '')\n target.query = relative.query\n } else {\n if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {\n // target.authority = relative.authority;\n target.userinfo = relative.userinfo\n target.host = relative.host\n target.port = relative.port\n target.path = removeDotSegments(relative.path || '')\n target.query = relative.query\n } else {\n if (!relative.path) {\n target.path = base.path\n if (relative.query !== undefined) {\n target.query = relative.query\n } else {\n target.query = base.query\n }\n } else {\n if (relative.path[0] === '/') {\n target.path = removeDotSegments(relative.path)\n } else {\n if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {\n target.path = '/' + relative.path\n } else if (!base.path) {\n target.path = relative.path\n } else {\n target.path = base.path.slice(0, base.path.lastIndexOf('/') + 1) + relative.path\n }\n target.path = removeDotSegments(target.path)\n }\n target.query = relative.query\n }\n // target.authority = base.authority;\n target.userinfo = base.userinfo\n target.host = base.host\n target.port = base.port\n }\n target.scheme = base.scheme\n }\n\n target.fragment = relative.fragment\n\n return target\n}\n\n/**\n * @param {import ('./types/index').URIComponent|string} uriA\n * @param {import ('./types/index').URIComponent|string} uriB\n * @param {import ('./types/index').Options} options\n * @returns {boolean}\n */\nfunction equal (uriA, uriB, options) {\n const normalizedA = normalizeComparableURI(uriA, options)\n const normalizedB = normalizeComparableURI(uriB, options)\n\n return normalizedA !== undefined && normalizedB !== undefined && normalizedA.toLowerCase() === normalizedB.toLowerCase()\n}\n\n/**\n * @param {Readonly<import('./types/index').URIComponent>} cmpts\n * @param {import('./types/index').Options} [opts]\n * @returns {string}\n */\nfunction serialize (cmpts, opts) {\n const component = {\n host: cmpts.host,\n scheme: cmpts.scheme,\n userinfo: cmpts.userinfo,\n port: cmpts.port,\n path: cmpts.path,\n query: cmpts.query,\n nid: cmpts.nid,\n nss: cmpts.nss,\n uuid: cmpts.uuid,\n fragment: cmpts.fragment,\n reference: cmpts.reference,\n resourceName: cmpts.resourceName,\n secure: cmpts.secure,\n error: ''\n }\n const options = Object.assign({}, opts)\n const uriTokens = []\n\n // find scheme handler\n const schemeHandler = getSchemeHandler(options.scheme || component.scheme)\n\n // perform scheme specific serialization\n if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options)\n\n if (component.path !== undefined) {\n if (!options.skipEscape) {\n component.path = escapePreservingEscapes(component.path)\n\n if (component.scheme !== undefined) {\n component.path = component.path.split('%3A').join(':')\n }\n } else {\n component.path = normalizePercentEncoding(component.path)\n }\n }\n\n if (options.reference !== 'suffix' && component.scheme) {\n uriTokens.push(component.scheme, ':')\n }\n\n const authority = recomposeAuthority(component)\n if (authority !== undefined) {\n if (options.reference !== 'suffix') {\n uriTokens.push('//')\n }\n\n uriTokens.push(authority)\n\n if (component.path && component.path[0] !== '/') {\n uriTokens.push('/')\n }\n }\n if (component.path !== undefined) {\n let s = component.path\n\n if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {\n s = removeDotSegments(s)\n }\n\n if (\n authority === undefined &&\n s[0] === '/' &&\n s[1] === '/'\n ) {\n // don't allow the path to start with \"//\"\n s = '/%2F' + s.slice(2)\n }\n\n uriTokens.push(s)\n }\n\n if (component.query !== undefined) {\n uriTokens.push('?', component.query)\n }\n\n if (component.fragment !== undefined) {\n uriTokens.push('#', component.fragment)\n }\n return uriTokens.join('')\n}\n\nconst URI_PARSE = /^(?:([^#/:?]+):)?(?:\\/\\/((?:([^#/?@]*)@)?(\\[[^#/?\\]]+\\]|[^#/:?]*)(?::(\\d*))?))?([^#?]*)(?:\\?([^#]*))?(?:#((?:.|[\\n\\r])*))?/u\n\n// Captures the authority component (between \"//\" and the next \"/\", \"?\" or \"#\"),\n// with or without a scheme prefix, for the literal-backslash rejection below.\nconst AUTHORITY_PREFIX = /^(?:[^#/:?]+:)?\\/\\/([^/?#]*)/\n\n// Captures the leading authority-introducer region after an optional scheme: a\n// run of forward slashes, backslashes, and the characters the WHATWG URL parser\n// removes before parsing (TAB U+0009, LF U+000A, CR U+000D). A valid introducer\n// is exactly \"//\". Node treats \"\\\" as \"/\" on special schemes and strips those\n// characters first, so forms like \"\\\\\", \"/\\\", \"\\/\", \"/<TAB>/\", or a leading\n// \"<TAB>//\" reach an authority in Node while fast-uri's URI_PARSE folds them into\n// the path group (host confusion / SSRF / redirect bypass).\nconst AUTHORITY_INTRODUCER_REGION = /^(?:[^#/:?]+:)?([/\\\\\\t\\n\\r]*)/\n\n/**\n * @param {import('./types/index').URIComponent} parsed\n * @param {RegExpMatchArray} matches\n * @returns {string|undefined}\n */\nfunction getParseError (parsed, matches) {\n if (matches[2] !== undefined && parsed.path && parsed.path[0] !== '/') {\n return 'URI path must start with \"/\" when authority is present.'\n }\n\n if (typeof parsed.port === 'number' && (parsed.port < 0 || parsed.port > 65535)) {\n return 'URI port is malformed.'\n }\n\n return undefined\n}\n\n/**\n * @param {string} uri\n * @param {import('./types/index').Options} [opts]\n * @returns {{ parsed: import('./types/index').URIComponent, malformedAuthorityOrPort: boolean }}\n */\nfunction parseWithStatus (uri, opts) {\n const options = Object.assign({}, opts)\n /** @type {import('./types/index').URIComponent} */\n const parsed = {\n scheme: undefined,\n userinfo: undefined,\n host: '',\n port: undefined,\n path: '',\n query: undefined,\n fragment: undefined\n }\n\n let malformedAuthorityOrPort = false\n\n let isIP = false\n if (options.reference === 'suffix') {\n if (options.scheme) {\n uri = options.scheme + ':' + uri\n } else {\n uri = '//' + uri\n }\n }\n\n // A literal backslash (U+005C) is not a valid RFC 3986 URI character and is\n // not an authority delimiter. Reject it in the authority rather than\n // rewriting it: normalizing \"\\\" -> \"/\" (WHATWG error recovery) could silently\n // change the resource identified by an otherwise-invalid input, and lets \"\\\"\n // act as a host delimiter here while Node's native URL parses a different\n // host (SSRF / redirect / origin-allowlist bypass). Percent-encoded %5C is\n // untouched and remains valid encoded data.\n const authorityMatch = uri.match(AUTHORITY_PREFIX)\n if (authorityMatch !== null && authorityMatch[1].indexOf('\\\\') !== -1) {\n parsed.error = 'URI authority must not contain a literal backslash.'\n malformedAuthorityOrPort = true\n }\n\n // Reject a malformed or whitespace-smuggled authority introducer. fast-uri\n // only recognizes a literal \"//\"; anything else in the leading separator run\n // (a backslash, or a \"//\" that appears only after removing the TAB/LF/CR that\n // Node strips) means the authority fast-uri parses differs from the one Node's\n // URL resolves. Reject rather than rewrite, mirroring the literal-backslash\n // guard above. Percent-encoded forms (%5C, %09) are untouched, valid data.\n const introducerMatch = uri.match(AUTHORITY_INTRODUCER_REGION)\n if (introducerMatch !== null) {\n const region = introducerMatch[1]\n const normalizedRegion = region.replace(/[\\t\\n\\r]/g, '')\n // Two or more leading separators introduce an authority.\n if (normalizedRegion.length >= 2) {\n if (normalizedRegion.slice(0, 2) !== '//') {\n parsed.error = parsed.error || 'URI authority must not contain a literal backslash.'\n malformedAuthorityOrPort = true\n } else if (region.length !== normalizedRegion.length) {\n parsed.error = parsed.error || 'URI authority introducer must not contain whitespace.'\n malformedAuthorityOrPort = true\n }\n }\n }\n\n const matches = uri.match(URI_PARSE)\n\n if (matches) {\n // store each component\n parsed.scheme = matches[1] === undefined ? undefined : matches[1].toLowerCase()\n parsed.userinfo = matches[3]\n parsed.host = matches[4]\n parsed.port = parseInt(matches[5], 10)\n parsed.path = matches[6] || ''\n parsed.query = matches[7]\n parsed.fragment = matches[8]\n\n // fix port number\n if (isNaN(parsed.port)) {\n parsed.port = matches[5]\n }\n\n const parseError = getParseError(parsed, matches)\n if (parseError !== undefined) {\n parsed.error = parsed.error || parseError\n malformedAuthorityOrPort = true\n }\n\n if (parsed.host) {\n const ipv4result = isIPv4(parsed.host)\n if (ipv4result === false) {\n const ipv6result = normalizeIPv6(parsed.host)\n parsed.host = ipv6result.host.toLowerCase()\n isIP = ipv6result.isIPV6\n } else {\n isIP = true\n }\n }\n if (parsed.scheme === undefined && parsed.userinfo === undefined && parsed.host === undefined && parsed.port === undefined && parsed.query === undefined && !parsed.path) {\n parsed.reference = 'same-document'\n } else if (parsed.scheme === undefined) {\n parsed.reference = 'relative'\n } else if (parsed.fragment === undefined) {\n parsed.reference = 'absolute'\n } else {\n parsed.reference = 'uri'\n }\n\n // check for reference errors\n if (options.reference && options.reference !== 'suffix' && options.reference !== parsed.reference) {\n parsed.error = parsed.error || 'URI is not a ' + options.reference + ' reference.'\n }\n\n // find scheme handler\n const schemeHandler = getSchemeHandler(options.scheme || parsed.scheme)\n\n // check if scheme can't handle IRIs\n if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {\n // if host component is a domain name\n if (parsed.host && (options.domainHost || (schemeHandler && schemeHandler.domainHost)) && isIP === false && nonSimpleDomain(parsed.host)) {\n // convert Unicode IDN -> ASCII IDN\n try {\n parsed.host = new URL('http://' + parsed.host).hostname\n } catch (e) {\n parsed.error = parsed.error || \"Host's domain name can not be converted to ASCII: \" + e\n }\n }\n // convert IRI -> URI\n }\n\n if (!schemeHandler || (schemeHandler && !schemeHandler.skipNormalize)) {\n if (uri.indexOf('%') !== -1) {\n if (parsed.scheme !== undefined) {\n parsed.scheme = unescape(parsed.scheme)\n }\n if (parsed.host !== undefined) {\n parsed.host = reescapeHostDelimiters(unescape(parsed.host), isIP)\n }\n }\n if (parsed.path) {\n parsed.path = normalizePathEncoding(parsed.path)\n }\n if (parsed.query) {\n parsed.query = normalizeQueryFragmentEncoding(parsed.query)\n }\n if (parsed.fragment) {\n parsed.fragment = normalizeQueryFragmentEncoding(parsed.fragment)\n }\n }\n\n // perform scheme specific parsing\n if (schemeHandler && schemeHandler.parse) {\n schemeHandler.parse(parsed, options)\n }\n } else {\n parsed.error = parsed.error || 'URI can not be parsed.'\n }\n return { parsed, malformedAuthorityOrPort }\n}\n\n/**\n * @param {string} uri\n * @param {import('./types/index').Options} [opts]\n * @returns\n */\nfunction parse (uri, opts) {\n return parseWithStatus(uri, opts).parsed\n}\n\n/**\n * @param {string} uri\n * @param {import('./types/index').Options} [opts]\n * @returns {string}\n */\nfunction normalizeString (uri, opts) {\n return normalizeStringWithStatus(uri, opts).normalized\n}\n\n/**\n * @param {string} uri\n * @param {import('./types/index').Options} [opts]\n * @returns {{ normalized: string, malformedAuthorityOrPort: boolean }}\n */\nfunction normalizeStringWithStatus (uri, opts) {\n const { parsed, malformedAuthorityOrPort } = parseWithStatus(uri, opts)\n return {\n normalized: malformedAuthorityOrPort ? uri : serialize(parsed, opts),\n malformedAuthorityOrPort\n }\n}\n\n/**\n * @param {import ('./types/index').URIComponent|string} uri\n * @param {import('./types/index').Options} [opts]\n * @returns {string|undefined}\n */\nfunction normalizeComparableURI (uri, opts) {\n if (typeof uri === 'string') {\n const { normalized, malformedAuthorityOrPort } = normalizeStringWithStatus(uri, opts)\n return malformedAuthorityOrPort ? undefined : normalized\n }\n\n if (typeof uri === 'object') {\n return serialize(uri, opts)\n }\n}\n\nconst fastUri = {\n SCHEMES,\n normalize,\n resolve,\n resolveComponent,\n equal,\n serialize,\n parse\n}\n\nmodule.exports = fastUri\nmodule.exports.default = fastUri\nmodule.exports.fastUri = fastUri\n", "var hasExcape = /~/\nvar escapeMatcher = /~[01]/g\nfunction escapeReplacer (m) {\n switch (m) {\n case '~1': return '/'\n case '~0': return '~'\n }\n throw new Error('Invalid tilde escape: ' + m)\n}\n\nfunction untilde (str) {\n if (!hasExcape.test(str)) return str\n return str.replace(escapeMatcher, escapeReplacer)\n}\n\nfunction setter (obj, pointer, value) {\n var part\n var hasNextPart\n\n for (var p = 1, len = pointer.length; p < len;) {\n if (pointer[p] === 'constructor' || pointer[p] === 'prototype' || pointer[p] === '__proto__') return obj\n\n part = untilde(pointer[p++])\n hasNextPart = len > p\n\n if (typeof obj[part] === 'undefined') {\n // support setting of /-\n if (Array.isArray(obj) && part === '-') {\n part = obj.length\n }\n\n // support nested objects/array when setting values\n if (hasNextPart) {\n if ((pointer[p] !== '' && pointer[p] < Infinity) || pointer[p] === '-') obj[part] = []\n else obj[part] = {}\n }\n }\n\n if (!hasNextPart) break\n obj = obj[part]\n }\n\n var oldValue = obj[part]\n if (value === undefined) delete obj[part]\n else obj[part] = value\n return oldValue\n}\n\nfunction compilePointer (pointer) {\n if (typeof pointer === 'string') {\n pointer = pointer.split('/')\n if (pointer[0] === '') return pointer\n throw new Error('Invalid JSON pointer.')\n } else if (Array.isArray(pointer)) {\n for (const part of pointer) {\n if (typeof part !== 'string' && typeof part !== 'number') {\n throw new Error('Invalid JSON pointer. Must be of type string or number.')\n }\n }\n return pointer\n }\n\n throw new Error('Invalid JSON pointer.')\n}\n\nfunction get (obj, pointer) {\n if (typeof obj !== 'object') throw new Error('Invalid input object.')\n pointer = compilePointer(pointer)\n var len = pointer.length\n if (len === 1) return obj\n\n for (var p = 1; p < len;) {\n obj = obj[untilde(pointer[p++])]\n if (len === p) return obj\n if (typeof obj !== 'object' || obj === null) return undefined\n }\n}\n\nfunction set (obj, pointer, value) {\n if (typeof obj !== 'object') throw new Error('Invalid input object.')\n pointer = compilePointer(pointer)\n if (pointer.length === 0) throw new Error('Invalid JSON pointer for set.')\n return setter(obj, pointer, value)\n}\n\nfunction compile (pointer) {\n var compiled = compilePointer(pointer)\n return {\n get: function (object) {\n return get(object, compiled)\n },\n set: function (object, value) {\n return set(object, compiled, value)\n }\n }\n}\n\nexports.get = get\nexports.set = set\nexports.compile = compile\n", "/**\n * @license React\n * react-is.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_SERVER_CONTEXT_TYPE = Symbol.for('react.server_context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction typeOf(object) {\n if (typeof object === 'object' && object !== null) {\n var $$typeof = object.$$typeof;\n\n switch ($$typeof) {\n case REACT_ELEMENT_TYPE:\n var type = object.type;\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n case REACT_PROFILER_TYPE:\n case REACT_STRICT_MODE_TYPE:\n case REACT_SUSPENSE_TYPE:\n case REACT_SUSPENSE_LIST_TYPE:\n return type;\n\n default:\n var $$typeofType = type && type.$$typeof;\n\n switch ($$typeofType) {\n case REACT_SERVER_CONTEXT_TYPE:\n case REACT_CONTEXT_TYPE:\n case REACT_FORWARD_REF_TYPE:\n case REACT_LAZY_TYPE:\n case REACT_MEMO_TYPE:\n case REACT_PROVIDER_TYPE:\n return $$typeofType;\n\n default:\n return $$typeof;\n }\n\n }\n\n case REACT_PORTAL_TYPE:\n return $$typeof;\n }\n }\n\n return undefined;\n}\nvar ContextConsumer = REACT_CONTEXT_TYPE;\nvar ContextProvider = REACT_PROVIDER_TYPE;\nvar Element = REACT_ELEMENT_TYPE;\nvar ForwardRef = REACT_FORWARD_REF_TYPE;\nvar Fragment = REACT_FRAGMENT_TYPE;\nvar Lazy = REACT_LAZY_TYPE;\nvar Memo = REACT_MEMO_TYPE;\nvar Portal = REACT_PORTAL_TYPE;\nvar Profiler = REACT_PROFILER_TYPE;\nvar StrictMode = REACT_STRICT_MODE_TYPE;\nvar Suspense = REACT_SUSPENSE_TYPE;\nvar SuspenseList = REACT_SUSPENSE_LIST_TYPE;\nvar hasWarnedAboutDeprecatedIsAsyncMode = false;\nvar hasWarnedAboutDeprecatedIsConcurrentMode = false; // AsyncMode should be deprecated\n\nfunction isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint\n\n console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 18+.');\n }\n }\n\n return false;\n}\nfunction isConcurrentMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsConcurrentMode) {\n hasWarnedAboutDeprecatedIsConcurrentMode = true; // Using console['warn'] to evade Babel and ESLint\n\n console['warn']('The ReactIs.isConcurrentMode() alias has been deprecated, ' + 'and will be removed in React 18+.');\n }\n }\n\n return false;\n}\nfunction isContextConsumer(object) {\n return typeOf(object) === REACT_CONTEXT_TYPE;\n}\nfunction isContextProvider(object) {\n return typeOf(object) === REACT_PROVIDER_TYPE;\n}\nfunction isElement(object) {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n}\nfunction isForwardRef(object) {\n return typeOf(object) === REACT_FORWARD_REF_TYPE;\n}\nfunction isFragment(object) {\n return typeOf(object) === REACT_FRAGMENT_TYPE;\n}\nfunction isLazy(object) {\n return typeOf(object) === REACT_LAZY_TYPE;\n}\nfunction isMemo(object) {\n return typeOf(object) === REACT_MEMO_TYPE;\n}\nfunction isPortal(object) {\n return typeOf(object) === REACT_PORTAL_TYPE;\n}\nfunction isProfiler(object) {\n return typeOf(object) === REACT_PROFILER_TYPE;\n}\nfunction isStrictMode(object) {\n return typeOf(object) === REACT_STRICT_MODE_TYPE;\n}\nfunction isSuspense(object) {\n return typeOf(object) === REACT_SUSPENSE_TYPE;\n}\nfunction isSuspenseList(object) {\n return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;\n}\n\nexports.ContextConsumer = ContextConsumer;\nexports.ContextProvider = ContextProvider;\nexports.Element = Element;\nexports.ForwardRef = ForwardRef;\nexports.Fragment = Fragment;\nexports.Lazy = Lazy;\nexports.Memo = Memo;\nexports.Portal = Portal;\nexports.Profiler = Profiler;\nexports.StrictMode = StrictMode;\nexports.Suspense = Suspense;\nexports.SuspenseList = SuspenseList;\nexports.isAsyncMode = isAsyncMode;\nexports.isConcurrentMode = isConcurrentMode;\nexports.isContextConsumer = isContextConsumer;\nexports.isContextProvider = isContextProvider;\nexports.isElement = isElement;\nexports.isForwardRef = isForwardRef;\nexports.isFragment = isFragment;\nexports.isLazy = isLazy;\nexports.isMemo = isMemo;\nexports.isPortal = isPortal;\nexports.isProfiler = isProfiler;\nexports.isStrictMode = isStrictMode;\nexports.isSuspense = isSuspense;\nexports.isSuspenseList = isSuspenseList;\nexports.isValidElementType = isValidElementType;\nexports.typeOf = typeOf;\n })();\n}\n", "'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n", "// eslint-disable-next-line @typescript-eslint/no-extraneous-class\nexport abstract class _CodeOrName {\n abstract readonly str: string\n abstract readonly names: UsedNames\n abstract toString(): string\n abstract emptyStr(): boolean\n}\n\nexport const IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i\n\nexport class Name extends _CodeOrName {\n readonly str: string\n constructor(s: string) {\n super()\n if (!IDENTIFIER.test(s)) throw new Error(\"CodeGen: name must be a valid identifier\")\n this.str = s\n }\n\n toString(): string {\n return this.str\n }\n\n emptyStr(): boolean {\n return false\n }\n\n get names(): UsedNames {\n return {[this.str]: 1}\n }\n}\n\nexport class _Code extends _CodeOrName {\n readonly _items: readonly CodeItem[]\n private _str?: string\n private _names?: UsedNames\n\n constructor(code: string | readonly CodeItem[]) {\n super()\n this._items = typeof code === \"string\" ? [code] : code\n }\n\n toString(): string {\n return this.str\n }\n\n emptyStr(): boolean {\n if (this._items.length > 1) return false\n const item = this._items[0]\n return item === \"\" || item === '\"\"'\n }\n\n get str(): string {\n return (this._str ??= this._items.reduce((s: string, c: CodeItem) => `${s}${c}`, \"\"))\n }\n\n get names(): UsedNames {\n return (this._names ??= this._items.reduce((names: UsedNames, c) => {\n if (c instanceof Name) names[c.str] = (names[c.str] || 0) + 1\n return names\n }, {}))\n }\n}\n\nexport type CodeItem = Name | string | number | boolean | null\n\nexport type UsedNames = Record<string, number | undefined>\n\nexport type Code = _Code | Name\n\nexport type SafeExpr = Code | number | boolean | null\n\nexport const nil = new _Code(\"\")\n\ntype CodeArg = SafeExpr | string | undefined\n\nexport function _(strs: TemplateStringsArray, ...args: CodeArg[]): _Code {\n const code: CodeItem[] = [strs[0]]\n let i = 0\n while (i < args.length) {\n addCodeArg(code, args[i])\n code.push(strs[++i])\n }\n return new _Code(code)\n}\n\nconst plus = new _Code(\"+\")\n\nexport function str(strs: TemplateStringsArray, ...args: (CodeArg | string[])[]): _Code {\n const expr: CodeItem[] = [safeStringify(strs[0])]\n let i = 0\n while (i < args.length) {\n expr.push(plus)\n addCodeArg(expr, args[i])\n expr.push(plus, safeStringify(strs[++i]))\n }\n optimize(expr)\n return new _Code(expr)\n}\n\nexport function addCodeArg(code: CodeItem[], arg: CodeArg | string[]): void {\n if (arg instanceof _Code) code.push(...arg._items)\n else if (arg instanceof Name) code.push(arg)\n else code.push(interpolate(arg))\n}\n\nfunction optimize(expr: CodeItem[]): void {\n let i = 1\n while (i < expr.length - 1) {\n if (expr[i] === plus) {\n const res = mergeExprItems(expr[i - 1], expr[i + 1])\n if (res !== undefined) {\n expr.splice(i - 1, 3, res)\n continue\n }\n expr[i++] = \"+\"\n }\n i++\n }\n}\n\nfunction mergeExprItems(a: CodeItem, b: CodeItem): CodeItem | undefined {\n if (b === '\"\"') return a\n if (a === '\"\"') return b\n if (typeof a == \"string\") {\n if (b instanceof Name || a[a.length - 1] !== '\"') return\n if (typeof b != \"string\") return `${a.slice(0, -1)}${b}\"`\n if (b[0] === '\"') return a.slice(0, -1) + b.slice(1)\n return\n }\n if (typeof b == \"string\" && b[0] === '\"' && !(a instanceof Name)) return `\"${a}${b.slice(1)}`\n return\n}\n\nexport function strConcat(c1: Code, c2: Code): Code {\n return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str`${c1}${c2}`\n}\n\n// TODO do not allow arrays here\nfunction interpolate(x?: string | string[] | number | boolean | null): SafeExpr | string {\n return typeof x == \"number\" || typeof x == \"boolean\" || x === null\n ? x\n : safeStringify(Array.isArray(x) ? x.join(\",\") : x)\n}\n\nexport function stringify(x: unknown): Code {\n return new _Code(safeStringify(x))\n}\n\nexport function safeStringify(x: unknown): string {\n return JSON.stringify(x)\n .replace(/\\u2028/g, \"\\\\u2028\")\n .replace(/\\u2029/g, \"\\\\u2029\")\n}\n\nexport function getProperty(key: Code | string | number): Code {\n return typeof key == \"string\" && IDENTIFIER.test(key) ? new _Code(`.${key}`) : _`[${key}]`\n}\n\n//Does best effort to format the name properly\nexport function getEsmExportName(key: Code | string | number): Code {\n if (typeof key == \"string\" && IDENTIFIER.test(key)) {\n return new _Code(`${key}`)\n }\n throw new Error(`CodeGen: invalid export name: ${key}, use explicit $id name mapping`)\n}\n\nexport function regexpCode(rx: RegExp): Code {\n return new _Code(rx.toString())\n}\n", "import {_, nil, Code, Name} from \"./code\"\n\ninterface NameGroup {\n prefix: string\n index: number\n}\n\nexport interface NameValue {\n ref: ValueReference // this is the reference to any value that can be referred to from generated code via `globals` var in the closure\n key?: unknown // any key to identify a global to avoid duplicates, if not passed ref is used\n code?: Code // this is the code creating the value needed for standalone code wit_out closure - can be a primitive value, function or import (`require`)\n}\n\nexport type ValueReference = unknown // possibly make CodeGen parameterized type on this type\n\nclass ValueError extends Error {\n readonly value?: NameValue\n constructor(name: ValueScopeName) {\n super(`CodeGen: \"code\" for ${name} not defined`)\n this.value = name.value\n }\n}\n\ninterface ScopeOptions {\n prefixes?: Set<string>\n parent?: Scope\n}\n\ninterface ValueScopeOptions extends ScopeOptions {\n scope: ScopeStore\n es5?: boolean\n lines?: boolean\n}\n\nexport type ScopeStore = Record<string, ValueReference[] | undefined>\n\ntype ScopeValues = {\n [Prefix in string]?: Map<unknown, ValueScopeName>\n}\n\nexport type ScopeValueSets = {\n [Prefix in string]?: Set<ValueScopeName>\n}\n\nexport enum UsedValueState {\n Started,\n Completed,\n}\n\nexport type UsedScopeValues = {\n [Prefix in string]?: Map<ValueScopeName, UsedValueState | undefined>\n}\n\nexport const varKinds = {\n const: new Name(\"const\"),\n let: new Name(\"let\"),\n var: new Name(\"var\"),\n}\n\nexport class Scope {\n protected readonly _names: {[Prefix in string]?: NameGroup} = {}\n protected readonly _prefixes?: Set<string>\n protected readonly _parent?: Scope\n\n constructor({prefixes, parent}: ScopeOptions = {}) {\n this._prefixes = prefixes\n this._parent = parent\n }\n\n toName(nameOrPrefix: Name | string): Name {\n return nameOrPrefix instanceof Name ? nameOrPrefix : this.name(nameOrPrefix)\n }\n\n name(prefix: string): Name {\n return new Name(this._newName(prefix))\n }\n\n protected _newName(prefix: string): string {\n const ng = this._names[prefix] || this._nameGroup(prefix)\n return `${prefix}${ng.index++}`\n }\n\n private _nameGroup(prefix: string): NameGroup {\n if (this._parent?._prefixes?.has(prefix) || (this._prefixes && !this._prefixes.has(prefix))) {\n throw new Error(`CodeGen: prefix \"${prefix}\" is not allowed in this scope`)\n }\n return (this._names[prefix] = {prefix, index: 0})\n }\n}\n\ninterface ScopePath {\n property: string\n itemIndex: number\n}\n\nexport class ValueScopeName extends Name {\n readonly prefix: string\n value?: NameValue\n scopePath?: Code\n\n constructor(prefix: string, nameStr: string) {\n super(nameStr)\n this.prefix = prefix\n }\n\n setValue(value: NameValue, {property, itemIndex}: ScopePath): void {\n this.value = value\n this.scopePath = _`.${new Name(property)}[${itemIndex}]`\n }\n}\n\ninterface VSOptions extends ValueScopeOptions {\n _n: Code\n}\n\nconst line = _`\\n`\n\nexport class ValueScope extends Scope {\n protected readonly _values: ScopeValues = {}\n protected readonly _scope: ScopeStore\n readonly opts: VSOptions\n\n constructor(opts: ValueScopeOptions) {\n super(opts)\n this._scope = opts.scope\n this.opts = {...opts, _n: opts.lines ? line : nil}\n }\n\n get(): ScopeStore {\n return this._scope\n }\n\n name(prefix: string): ValueScopeName {\n return new ValueScopeName(prefix, this._newName(prefix))\n }\n\n value(nameOrPrefix: ValueScopeName | string, value: NameValue): ValueScopeName {\n if (value.ref === undefined) throw new Error(\"CodeGen: ref must be passed in value\")\n const name = this.toName(nameOrPrefix) as ValueScopeName\n const {prefix} = name\n const valueKey = value.key ?? value.ref\n let vs = this._values[prefix]\n if (vs) {\n const _name = vs.get(valueKey)\n if (_name) return _name\n } else {\n vs = this._values[prefix] = new Map()\n }\n vs.set(valueKey, name)\n\n const s = this._scope[prefix] || (this._scope[prefix] = [])\n const itemIndex = s.length\n s[itemIndex] = value.ref\n name.setValue(value, {property: prefix, itemIndex})\n return name\n }\n\n getValue(prefix: string, keyOrRef: unknown): ValueScopeName | undefined {\n const vs = this._values[prefix]\n if (!vs) return\n return vs.get(keyOrRef)\n }\n\n scopeRefs(scopeName: Name, values: ScopeValues | ScopeValueSets = this._values): Code {\n return this._reduceValues(values, (name: ValueScopeName) => {\n if (name.scopePath === undefined) throw new Error(`CodeGen: name \"${name}\" has no value`)\n return _`${scopeName}${name.scopePath}`\n })\n }\n\n scopeCode(\n values: ScopeValues | ScopeValueSets = this._values,\n usedValues?: UsedScopeValues,\n getCode?: (n: ValueScopeName) => Code | undefined\n ): Code {\n return this._reduceValues(\n values,\n (name: ValueScopeName) => {\n if (name.value === undefined) throw new Error(`CodeGen: name \"${name}\" has no value`)\n return name.value.code\n },\n usedValues,\n getCode\n )\n }\n\n private _reduceValues(\n values: ScopeValues | ScopeValueSets,\n valueCode: (n: ValueScopeName) => Code | undefined,\n usedValues: UsedScopeValues = {},\n getCode?: (n: ValueScopeName) => Code | undefined\n ): Code {\n let code: Code = nil\n for (const prefix in values) {\n const vs = values[prefix]\n if (!vs) continue\n const nameSet = (usedValues[prefix] = usedValues[prefix] || new Map())\n vs.forEach((name: ValueScopeName) => {\n if (nameSet.has(name)) return\n nameSet.set(name, UsedValueState.Started)\n let c = valueCode(name)\n if (c) {\n const def = this.opts.es5 ? varKinds.var : varKinds.const\n code = _`${code}${def} ${name} = ${c};${this.opts._n}`\n } else if ((c = getCode?.(name))) {\n code = _`${code}${c}${this.opts._n}`\n } else {\n throw new ValueError(name)\n }\n nameSet.set(name, UsedValueState.Completed)\n })\n }\n return code\n }\n}\n", "import type {ScopeValueSets, NameValue, ValueScope, ValueScopeName} from \"./scope\"\nimport {_, nil, _Code, Code, Name, UsedNames, CodeItem, addCodeArg, _CodeOrName} from \"./code\"\nimport {Scope, varKinds} from \"./scope\"\n\nexport {_, str, strConcat, nil, getProperty, stringify, regexpCode, Name, Code} from \"./code\"\nexport {Scope, ScopeStore, ValueScope, ValueScopeName, ScopeValueSets, varKinds} from \"./scope\"\n\n// type for expressions that can be safely inserted in code without quotes\nexport type SafeExpr = Code | number | boolean | null\n\n// type that is either Code of function that adds code to CodeGen instance using its methods\nexport type Block = Code | (() => void)\n\nexport const operators = {\n GT: new _Code(\">\"),\n GTE: new _Code(\">=\"),\n LT: new _Code(\"<\"),\n LTE: new _Code(\"<=\"),\n EQ: new _Code(\"===\"),\n NEQ: new _Code(\"!==\"),\n NOT: new _Code(\"!\"),\n OR: new _Code(\"||\"),\n AND: new _Code(\"&&\"),\n ADD: new _Code(\"+\"),\n}\n\nabstract class Node {\n abstract readonly names: UsedNames\n\n optimizeNodes(): this | ChildNode | ChildNode[] | undefined {\n return this\n }\n\n optimizeNames(_names: UsedNames, _constants: Constants): this | undefined {\n return this\n }\n\n // get count(): number {\n // return 1\n // }\n}\n\nclass Def extends Node {\n constructor(\n private readonly varKind: Name,\n private readonly name: Name,\n private rhs?: SafeExpr\n ) {\n super()\n }\n\n render({es5, _n}: CGOptions): string {\n const varKind = es5 ? varKinds.var : this.varKind\n const rhs = this.rhs === undefined ? \"\" : ` = ${this.rhs}`\n return `${varKind} ${this.name}${rhs};` + _n\n }\n\n optimizeNames(names: UsedNames, constants: Constants): this | undefined {\n if (!names[this.name.str]) return\n if (this.rhs) this.rhs = optimizeExpr(this.rhs, names, constants)\n return this\n }\n\n get names(): UsedNames {\n return this.rhs instanceof _CodeOrName ? this.rhs.names : {}\n }\n}\n\nclass Assign extends Node {\n constructor(\n readonly lhs: Code,\n public rhs: SafeExpr,\n private readonly sideEffects?: boolean\n ) {\n super()\n }\n\n render({_n}: CGOptions): string {\n return `${this.lhs} = ${this.rhs};` + _n\n }\n\n optimizeNames(names: UsedNames, constants: Constants): this | undefined {\n if (this.lhs instanceof Name && !names[this.lhs.str] && !this.sideEffects) return\n this.rhs = optimizeExpr(this.rhs, names, constants)\n return this\n }\n\n get names(): UsedNames {\n const names = this.lhs instanceof Name ? {} : {...this.lhs.names}\n return addExprNames(names, this.rhs)\n }\n}\n\nclass AssignOp extends Assign {\n constructor(\n lhs: Code,\n private readonly op: Code,\n rhs: SafeExpr,\n sideEffects?: boolean\n ) {\n super(lhs, rhs, sideEffects)\n }\n\n render({_n}: CGOptions): string {\n return `${this.lhs} ${this.op}= ${this.rhs};` + _n\n }\n}\n\nclass Label extends Node {\n readonly names: UsedNames = {}\n constructor(readonly label: Name) {\n super()\n }\n\n render({_n}: CGOptions): string {\n return `${this.label}:` + _n\n }\n}\n\nclass Break extends Node {\n readonly names: UsedNames = {}\n constructor(readonly label?: Code) {\n super()\n }\n\n render({_n}: CGOptions): string {\n const label = this.label ? ` ${this.label}` : \"\"\n return `break${label};` + _n\n }\n}\n\nclass Throw extends Node {\n constructor(readonly error: Code) {\n super()\n }\n\n render({_n}: CGOptions): string {\n return `throw ${this.error};` + _n\n }\n\n get names(): UsedNames {\n return this.error.names\n }\n}\n\nclass AnyCode extends Node {\n constructor(private code: SafeExpr) {\n super()\n }\n\n render({_n}: CGOptions): string {\n return `${this.code};` + _n\n }\n\n optimizeNodes(): this | undefined {\n return `${this.code}` ? this : undefined\n }\n\n optimizeNames(names: UsedNames, constants: Constants): this {\n this.code = optimizeExpr(this.code, names, constants)\n return this\n }\n\n get names(): UsedNames {\n return this.code instanceof _CodeOrName ? this.code.names : {}\n }\n}\n\nabstract class ParentNode extends Node {\n constructor(readonly nodes: ChildNode[] = []) {\n super()\n }\n\n render(opts: CGOptions): string {\n return this.nodes.reduce((code, n) => code + n.render(opts), \"\")\n }\n\n optimizeNodes(): this | ChildNode | ChildNode[] | undefined {\n const {nodes} = this\n let i = nodes.length\n while (i--) {\n const n = nodes[i].optimizeNodes()\n if (Array.isArray(n)) nodes.splice(i, 1, ...n)\n else if (n) nodes[i] = n\n else nodes.splice(i, 1)\n }\n return nodes.length > 0 ? this : undefined\n }\n\n optimizeNames(names: UsedNames, constants: Constants): this | undefined {\n const {nodes} = this\n let i = nodes.length\n while (i--) {\n // iterating backwards improves 1-pass optimization\n const n = nodes[i]\n if (n.optimizeNames(names, constants)) continue\n subtractNames(names, n.names)\n nodes.splice(i, 1)\n }\n return nodes.length > 0 ? this : undefined\n }\n\n get names(): UsedNames {\n return this.nodes.reduce((names: UsedNames, n) => addNames(names, n.names), {})\n }\n\n // get count(): number {\n // return this.nodes.reduce((c, n) => c + n.count, 1)\n // }\n}\n\nabstract class BlockNode extends ParentNode {\n render(opts: CGOptions): string {\n return \"{\" + opts._n + super.render(opts) + \"}\" + opts._n\n }\n}\n\nclass Root extends ParentNode {}\n\nclass Else extends BlockNode {\n static readonly kind = \"else\"\n}\n\nclass If extends BlockNode {\n static readonly kind = \"if\"\n else?: If | Else\n constructor(\n private condition: Code | boolean,\n nodes?: ChildNode[]\n ) {\n super(nodes)\n }\n\n render(opts: CGOptions): string {\n let code = `if(${this.condition})` + super.render(opts)\n if (this.else) code += \"else \" + this.else.render(opts)\n return code\n }\n\n optimizeNodes(): If | ChildNode[] | undefined {\n super.optimizeNodes()\n const cond = this.condition\n if (cond === true) return this.nodes // else is ignored here\n let e = this.else\n if (e) {\n const ns = e.optimizeNodes()\n e = this.else = Array.isArray(ns) ? new Else(ns) : (ns as Else | undefined)\n }\n if (e) {\n if (cond === false) return e instanceof If ? e : e.nodes\n if (this.nodes.length) return this\n return new If(not(cond), e instanceof If ? [e] : e.nodes)\n }\n if (cond === false || !this.nodes.length) return undefined\n return this\n }\n\n optimizeNames(names: UsedNames, constants: Constants): this | undefined {\n this.else = this.else?.optimizeNames(names, constants)\n if (!(super.optimizeNames(names, constants) || this.else)) return\n this.condition = optimizeExpr(this.condition, names, constants)\n return this\n }\n\n get names(): UsedNames {\n const names = super.names\n addExprNames(names, this.condition)\n if (this.else) addNames(names, this.else.names)\n return names\n }\n\n // get count(): number {\n // return super.count + (this.else?.count || 0)\n // }\n}\n\nabstract class For extends BlockNode {\n static readonly kind = \"for\"\n}\n\nclass ForLoop extends For {\n constructor(private iteration: Code) {\n super()\n }\n\n render(opts: CGOptions): string {\n return `for(${this.iteration})` + super.render(opts)\n }\n\n optimizeNames(names: UsedNames, constants: Constants): this | undefined {\n if (!super.optimizeNames(names, constants)) return\n this.iteration = optimizeExpr(this.iteration, names, constants)\n return this\n }\n\n get names(): UsedNames {\n return addNames(super.names, this.iteration.names)\n }\n}\n\nclass ForRange extends For {\n constructor(\n private readonly varKind: Name,\n private readonly name: Name,\n private readonly from: SafeExpr,\n private readonly to: SafeExpr\n ) {\n super()\n }\n\n render(opts: CGOptions): string {\n const varKind = opts.es5 ? varKinds.var : this.varKind\n const {name, from, to} = this\n return `for(${varKind} ${name}=${from}; ${name}<${to}; ${name}++)` + super.render(opts)\n }\n\n get names(): UsedNames {\n const names = addExprNames(super.names, this.from)\n return addExprNames(names, this.to)\n }\n}\n\nclass ForIter extends For {\n constructor(\n private readonly loop: \"of\" | \"in\",\n private readonly varKind: Name,\n private readonly name: Name,\n private iterable: Code\n ) {\n super()\n }\n\n render(opts: CGOptions): string {\n return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts)\n }\n\n optimizeNames(names: UsedNames, constants: Constants): this | undefined {\n if (!super.optimizeNames(names, constants)) return\n this.iterable = optimizeExpr(this.iterable, names, constants)\n return this\n }\n\n get names(): UsedNames {\n return addNames(super.names, this.iterable.names)\n }\n}\n\nclass Func extends BlockNode {\n static readonly kind = \"func\"\n constructor(\n public name: Name,\n public args: Code,\n public async?: boolean\n ) {\n super()\n }\n\n render(opts: CGOptions): string {\n const _async = this.async ? \"async \" : \"\"\n return `${_async}function ${this.name}(${this.args})` + super.render(opts)\n }\n}\n\nclass Return extends ParentNode {\n static readonly kind = \"return\"\n\n render(opts: CGOptions): string {\n return \"return \" + super.render(opts)\n }\n}\n\nclass Try extends BlockNode {\n catch?: Catch\n finally?: Finally\n\n render(opts: CGOptions): string {\n let code = \"try\" + super.render(opts)\n if (this.catch) code += this.catch.render(opts)\n if (this.finally) code += this.finally.render(opts)\n return code\n }\n\n optimizeNodes(): this {\n super.optimizeNodes()\n this.catch?.optimizeNodes() as Catch | undefined\n this.finally?.optimizeNodes() as Finally | undefined\n return this\n }\n\n optimizeNames(names: UsedNames, constants: Constants): this {\n super.optimizeNames(names, constants)\n this.catch?.optimizeNames(names, constants)\n this.finally?.optimizeNames(names, constants)\n return this\n }\n\n get names(): UsedNames {\n const names = super.names\n if (this.catch) addNames(names, this.catch.names)\n if (this.finally) addNames(names, this.finally.names)\n return names\n }\n\n // get count(): number {\n // return super.count + (this.catch?.count || 0) + (this.finally?.count || 0)\n // }\n}\n\nclass Catch extends BlockNode {\n static readonly kind = \"catch\"\n constructor(readonly error: Name) {\n super()\n }\n\n render(opts: CGOptions): string {\n return `catch(${this.error})` + super.render(opts)\n }\n}\n\nclass Finally extends BlockNode {\n static readonly kind = \"finally\"\n render(opts: CGOptions): string {\n return \"finally\" + super.render(opts)\n }\n}\n\ntype StartBlockNode = If | For | Func | Return | Try\n\ntype LeafNode = Def | Assign | Label | Break | Throw | AnyCode\n\ntype ChildNode = StartBlockNode | LeafNode\n\ntype EndBlockNodeType =\n | typeof If\n | typeof Else\n | typeof For\n | typeof Func\n | typeof Return\n | typeof Catch\n | typeof Finally\n\ntype Constants = Record<string, SafeExpr | undefined>\n\nexport interface CodeGenOptions {\n es5?: boolean\n lines?: boolean\n ownProperties?: boolean\n}\n\ninterface CGOptions extends CodeGenOptions {\n _n: \"\\n\" | \"\"\n}\n\nexport class CodeGen {\n readonly _scope: Scope\n readonly _extScope: ValueScope\n readonly _values: ScopeValueSets = {}\n private readonly _nodes: ParentNode[]\n private readonly _blockStarts: number[] = []\n private readonly _constants: Constants = {}\n private readonly opts: CGOptions\n\n constructor(extScope: ValueScope, opts: CodeGenOptions = {}) {\n this.opts = {...opts, _n: opts.lines ? \"\\n\" : \"\"}\n this._extScope = extScope\n this._scope = new Scope({parent: extScope})\n this._nodes = [new Root()]\n }\n\n toString(): string {\n return this._root.render(this.opts)\n }\n\n // returns unique name in the internal scope\n name(prefix: string): Name {\n return this._scope.name(prefix)\n }\n\n // reserves unique name in the external scope\n scopeName(prefix: string): ValueScopeName {\n return this._extScope.name(prefix)\n }\n\n // reserves unique name in the external scope and assigns value to it\n scopeValue(prefixOrName: ValueScopeName | string, value: NameValue): Name {\n const name = this._extScope.value(prefixOrName, value)\n const vs = this._values[name.prefix] || (this._values[name.prefix] = new Set())\n vs.add(name)\n return name\n }\n\n getScopeValue(prefix: string, keyOrRef: unknown): ValueScopeName | undefined {\n return this._extScope.getValue(prefix, keyOrRef)\n }\n\n // return code that assigns values in the external scope to the names that are used internally\n // (same names that were returned by gen.scopeName or gen.scopeValue)\n scopeRefs(scopeName: Name): Code {\n return this._extScope.scopeRefs(scopeName, this._values)\n }\n\n scopeCode(): Code {\n return this._extScope.scopeCode(this._values)\n }\n\n private _def(\n varKind: Name,\n nameOrPrefix: Name | string,\n rhs?: SafeExpr,\n constant?: boolean\n ): Name {\n const name = this._scope.toName(nameOrPrefix)\n if (rhs !== undefined && constant) this._constants[name.str] = rhs\n this._leafNode(new Def(varKind, name, rhs))\n return name\n }\n\n // `const` declaration (`var` in es5 mode)\n const(nameOrPrefix: Name | string, rhs: SafeExpr, _constant?: boolean): Name {\n return this._def(varKinds.const, nameOrPrefix, rhs, _constant)\n }\n\n // `let` declaration with optional assignment (`var` in es5 mode)\n let(nameOrPrefix: Name | string, rhs?: SafeExpr, _constant?: boolean): Name {\n return this._def(varKinds.let, nameOrPrefix, rhs, _constant)\n }\n\n // `var` declaration with optional assignment\n var(nameOrPrefix: Name | string, rhs?: SafeExpr, _constant?: boolean): Name {\n return this._def(varKinds.var, nameOrPrefix, rhs, _constant)\n }\n\n // assignment code\n assign(lhs: Code, rhs: SafeExpr, sideEffects?: boolean): CodeGen {\n return this._leafNode(new Assign(lhs, rhs, sideEffects))\n }\n\n // `+=` code\n add(lhs: Code, rhs: SafeExpr): CodeGen {\n return this._leafNode(new AssignOp(lhs, operators.ADD, rhs))\n }\n\n // appends passed SafeExpr to code or executes Block\n code(c: Block | SafeExpr): CodeGen {\n if (typeof c == \"function\") c()\n else if (c !== nil) this._leafNode(new AnyCode(c))\n return this\n }\n\n // returns code for object literal for the passed argument list of key-value pairs\n object(...keyValues: [Name | string, SafeExpr | string][]): _Code {\n const code: CodeItem[] = [\"{\"]\n for (const [key, value] of keyValues) {\n if (code.length > 1) code.push(\",\")\n code.push(key)\n if (key !== value || this.opts.es5) {\n code.push(\":\")\n addCodeArg(code, value)\n }\n }\n code.push(\"}\")\n return new _Code(code)\n }\n\n // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed)\n if(condition: Code | boolean, thenBody?: Block, elseBody?: Block): CodeGen {\n this._blockNode(new If(condition))\n\n if (thenBody && elseBody) {\n this.code(thenBody).else().code(elseBody).endIf()\n } else if (thenBody) {\n this.code(thenBody).endIf()\n } else if (elseBody) {\n throw new Error('CodeGen: \"else\" body without \"then\" body')\n }\n return this\n }\n\n // `else if` clause - invalid without `if` or after `else` clauses\n elseIf(condition: Code | boolean): CodeGen {\n return this._elseNode(new If(condition))\n }\n\n // `else` clause - only valid after `if` or `else if` clauses\n else(): CodeGen {\n return this._elseNode(new Else())\n }\n\n // end `if` statement (needed if gen.if was used only with condition)\n endIf(): CodeGen {\n return this._endBlockNode(If, Else)\n }\n\n private _for(node: For, forBody?: Block): CodeGen {\n this._blockNode(node)\n if (forBody) this.code(forBody).endFor()\n return this\n }\n\n // a generic `for` clause (or statement if `forBody` is passed)\n for(iteration: Code, forBody?: Block): CodeGen {\n return this._for(new ForLoop(iteration), forBody)\n }\n\n // `for` statement for a range of values\n forRange(\n nameOrPrefix: Name | string,\n from: SafeExpr,\n to: SafeExpr,\n forBody: (index: Name) => void,\n varKind: Code = this.opts.es5 ? varKinds.var : varKinds.let\n ): CodeGen {\n const name = this._scope.toName(nameOrPrefix)\n return this._for(new ForRange(varKind, name, from, to), () => forBody(name))\n }\n\n // `for-of` statement (in es5 mode replace with a normal for loop)\n forOf(\n nameOrPrefix: Name | string,\n iterable: Code,\n forBody: (item: Name) => void,\n varKind: Code = varKinds.const\n ): CodeGen {\n const name = this._scope.toName(nameOrPrefix)\n if (this.opts.es5) {\n const arr = iterable instanceof Name ? iterable : this.var(\"_arr\", iterable)\n return this.forRange(\"_i\", 0, _`${arr}.length`, (i) => {\n this.var(name, _`${arr}[${i}]`)\n forBody(name)\n })\n }\n return this._for(new ForIter(\"of\", varKind, name, iterable), () => forBody(name))\n }\n\n // `for-in` statement.\n // With option `ownProperties` replaced with a `for-of` loop for object keys\n forIn(\n nameOrPrefix: Name | string,\n obj: Code,\n forBody: (item: Name) => void,\n varKind: Code = this.opts.es5 ? varKinds.var : varKinds.const\n ): CodeGen {\n if (this.opts.ownProperties) {\n return this.forOf(nameOrPrefix, _`Object.keys(${obj})`, forBody)\n }\n const name = this._scope.toName(nameOrPrefix)\n return this._for(new ForIter(\"in\", varKind, name, obj), () => forBody(name))\n }\n\n // end `for` loop\n endFor(): CodeGen {\n return this._endBlockNode(For)\n }\n\n // `label` statement\n label(label: Name): CodeGen {\n return this._leafNode(new Label(label))\n }\n\n // `break` statement\n break(label?: Code): CodeGen {\n return this._leafNode(new Break(label))\n }\n\n // `return` statement\n return(value: Block | SafeExpr): CodeGen {\n const node = new Return()\n this._blockNode(node)\n this.code(value)\n if (node.nodes.length !== 1) throw new Error('CodeGen: \"return\" should have one node')\n return this._endBlockNode(Return)\n }\n\n // `try` statement\n try(tryBody: Block, catchCode?: (e: Name) => void, finallyCode?: Block): CodeGen {\n if (!catchCode && !finallyCode) throw new Error('CodeGen: \"try\" without \"catch\" and \"finally\"')\n const node = new Try()\n this._blockNode(node)\n this.code(tryBody)\n if (catchCode) {\n const error = this.name(\"e\")\n this._currNode = node.catch = new Catch(error)\n catchCode(error)\n }\n if (finallyCode) {\n this._currNode = node.finally = new Finally()\n this.code(finallyCode)\n }\n return this._endBlockNode(Catch, Finally)\n }\n\n // `throw` statement\n throw(error: Code): CodeGen {\n return this._leafNode(new Throw(error))\n }\n\n // start self-balancing block\n block(body?: Block, nodeCount?: number): CodeGen {\n this._blockStarts.push(this._nodes.length)\n if (body) this.code(body).endBlock(nodeCount)\n return this\n }\n\n // end the current self-balancing block\n endBlock(nodeCount?: number): CodeGen {\n const len = this._blockStarts.pop()\n if (len === undefined) throw new Error(\"CodeGen: not in self-balancing block\")\n const toClose = this._nodes.length - len\n if (toClose < 0 || (nodeCount !== undefined && toClose !== nodeCount)) {\n throw new Error(`CodeGen: wrong number of nodes: ${toClose} vs ${nodeCount} expected`)\n }\n this._nodes.length = len\n return this\n }\n\n // `function` heading (or definition if funcBody is passed)\n func(name: Name, args: Code = nil, async?: boolean, funcBody?: Block): CodeGen {\n this._blockNode(new Func(name, args, async))\n if (funcBody) this.code(funcBody).endFunc()\n return this\n }\n\n // end function definition\n endFunc(): CodeGen {\n return this._endBlockNode(Func)\n }\n\n optimize(n = 1): void {\n while (n-- > 0) {\n this._root.optimizeNodes()\n this._root.optimizeNames(this._root.names, this._constants)\n }\n }\n\n private _leafNode(node: LeafNode): CodeGen {\n this._currNode.nodes.push(node)\n return this\n }\n\n private _blockNode(node: StartBlockNode): void {\n this._currNode.nodes.push(node)\n this._nodes.push(node)\n }\n\n private _endBlockNode(N1: EndBlockNodeType, N2?: EndBlockNodeType): CodeGen {\n const n = this._currNode\n if (n instanceof N1 || (N2 && n instanceof N2)) {\n this._nodes.pop()\n return this\n }\n throw new Error(`CodeGen: not in block \"${N2 ? `${N1.kind}/${N2.kind}` : N1.kind}\"`)\n }\n\n private _elseNode(node: If | Else): CodeGen {\n const n = this._currNode\n if (!(n instanceof If)) {\n throw new Error('CodeGen: \"else\" without \"if\"')\n }\n this._currNode = n.else = node\n return this\n }\n\n private get _root(): Root {\n return this._nodes[0] as Root\n }\n\n private get _currNode(): ParentNode {\n const ns = this._nodes\n return ns[ns.length - 1]\n }\n\n private set _currNode(node: ParentNode) {\n const ns = this._nodes\n ns[ns.length - 1] = node\n }\n\n // get nodeCount(): number {\n // return this._root.count\n // }\n}\n\nfunction addNames(names: UsedNames, from: UsedNames): UsedNames {\n for (const n in from) names[n] = (names[n] || 0) + (from[n] || 0)\n return names\n}\n\nfunction addExprNames(names: UsedNames, from: SafeExpr): UsedNames {\n return from instanceof _CodeOrName ? addNames(names, from.names) : names\n}\n\nfunction optimizeExpr<T extends SafeExpr | Code>(expr: T, names: UsedNames, constants: Constants): T\nfunction optimizeExpr(expr: SafeExpr, names: UsedNames, constants: Constants): SafeExpr {\n if (expr instanceof Name) return replaceName(expr)\n if (!canOptimize(expr)) return expr\n return new _Code(\n expr._items.reduce((items: CodeItem[], c: SafeExpr | string) => {\n if (c instanceof Name) c = replaceName(c)\n if (c instanceof _Code) items.push(...c._items)\n else items.push(c)\n return items\n }, [])\n )\n\n function replaceName(n: Name): SafeExpr {\n const c = constants[n.str]\n if (c === undefined || names[n.str] !== 1) return n\n delete names[n.str]\n return c\n }\n\n function canOptimize(e: SafeExpr): e is _Code {\n return (\n e instanceof _Code &&\n e._items.some(\n (c) => c instanceof Name && names[c.str] === 1 && constants[c.str] !== undefined\n )\n )\n }\n}\n\nfunction subtractNames(names: UsedNames, from: UsedNames): void {\n for (const n in from) names[n] = (names[n] || 0) - (from[n] || 0)\n}\n\nexport function not<T extends Code | SafeExpr>(x: T): T\nexport function not(x: Code | SafeExpr): Code | SafeExpr {\n return typeof x == \"boolean\" || typeof x == \"number\" || x === null ? !x : _`!${par(x)}`\n}\n\nconst andCode = mappend(operators.AND)\n\n// boolean AND (&&) expression with the passed arguments\nexport function and(...args: Code[]): Code {\n return args.reduce(andCode)\n}\n\nconst orCode = mappend(operators.OR)\n\n// boolean OR (||) expression with the passed arguments\nexport function or(...args: Code[]): Code {\n return args.reduce(orCode)\n}\n\ntype MAppend = (x: Code, y: Code) => Code\n\nfunction mappend(op: Code): MAppend {\n return (x, y) => (x === nil ? y : y === nil ? x : _`${par(x)} ${op} ${par(y)}`)\n}\n\nfunction par(x: Code): Code {\n return x instanceof Name ? x : _`(${x})`\n}\n", "import type {AnySchema, EvaluatedProperties, EvaluatedItems} from \"../types\"\nimport type {SchemaCxt, SchemaObjCxt} from \".\"\nimport {_, getProperty, Code, Name, CodeGen} from \"./codegen\"\nimport {_Code} from \"./codegen/code\"\nimport type {Rule, ValidationRules} from \"./rules\"\n\n// TODO refactor to use Set\nexport function toHash<T extends string = string>(arr: T[]): {[K in T]?: true} {\n const hash: {[K in T]?: true} = {}\n for (const item of arr) hash[item] = true\n return hash\n}\n\nexport function alwaysValidSchema(it: SchemaCxt, schema: AnySchema): boolean | void {\n if (typeof schema == \"boolean\") return schema\n if (Object.keys(schema).length === 0) return true\n checkUnknownRules(it, schema)\n return !schemaHasRules(schema, it.self.RULES.all)\n}\n\nexport function checkUnknownRules(it: SchemaCxt, schema: AnySchema = it.schema): void {\n const {opts, self} = it\n if (!opts.strictSchema) return\n if (typeof schema === \"boolean\") return\n const rules = self.RULES.keywords\n for (const key in schema) {\n if (!rules[key]) checkStrictMode(it, `unknown keyword: \"${key}\"`)\n }\n}\n\nexport function schemaHasRules(\n schema: AnySchema,\n rules: {[Key in string]?: boolean | Rule}\n): boolean {\n if (typeof schema == \"boolean\") return !schema\n for (const key in schema) if (rules[key]) return true\n return false\n}\n\nexport function schemaHasRulesButRef(schema: AnySchema, RULES: ValidationRules): boolean {\n if (typeof schema == \"boolean\") return !schema\n for (const key in schema) if (key !== \"$ref\" && RULES.all[key]) return true\n return false\n}\n\nexport function schemaRefOrVal(\n {topSchemaRef, schemaPath}: SchemaObjCxt,\n schema: unknown,\n keyword: string,\n $data?: string | false\n): Code | number | boolean {\n if (!$data) {\n if (typeof schema == \"number\" || typeof schema == \"boolean\") return schema\n if (typeof schema == \"string\") return _`${schema}`\n }\n return _`${topSchemaRef}${schemaPath}${getProperty(keyword)}`\n}\n\nexport function unescapeFragment(str: string): string {\n return unescapeJsonPointer(decodeURIComponent(str))\n}\n\nexport function escapeFragment(str: string | number): string {\n return encodeURIComponent(escapeJsonPointer(str))\n}\n\nexport function escapeJsonPointer(str: string | number): string {\n if (typeof str == \"number\") return `${str}`\n return str.replace(/~/g, \"~0\").replace(/\\//g, \"~1\")\n}\n\nexport function unescapeJsonPointer(str: string): string {\n return str.replace(/~1/g, \"/\").replace(/~0/g, \"~\")\n}\n\nexport function eachItem<T>(xs: T | T[], f: (x: T) => void): void {\n if (Array.isArray(xs)) {\n for (const x of xs) f(x)\n } else {\n f(xs)\n }\n}\n\ntype SomeEvaluated = EvaluatedProperties | EvaluatedItems\n\ntype MergeEvaluatedFunc<T extends SomeEvaluated> = (\n gen: CodeGen,\n from: Name | T,\n to: Name | Exclude<T, true> | undefined,\n toName?: typeof Name\n) => Name | T\n\ninterface MakeMergeFuncArgs<T extends SomeEvaluated> {\n mergeNames: (gen: CodeGen, from: Name, to: Name) => void\n mergeToName: (gen: CodeGen, from: T, to: Name) => void\n mergeValues: (from: T, to: Exclude<T, true>) => T\n resultToName: (gen: CodeGen, res?: T) => Name\n}\n\nfunction makeMergeEvaluated<T extends SomeEvaluated>({\n mergeNames,\n mergeToName,\n mergeValues,\n resultToName,\n}: MakeMergeFuncArgs<T>): MergeEvaluatedFunc<T> {\n return (gen, from, to, toName) => {\n const res =\n to === undefined\n ? from\n : to instanceof Name\n ? (from instanceof Name ? mergeNames(gen, from, to) : mergeToName(gen, from, to), to)\n : from instanceof Name\n ? (mergeToName(gen, to, from), from)\n : mergeValues(from, to)\n return toName === Name && !(res instanceof Name) ? resultToName(gen, res) : res\n }\n}\n\ninterface MergeEvaluated {\n props: MergeEvaluatedFunc<EvaluatedProperties>\n items: MergeEvaluatedFunc<EvaluatedItems>\n}\n\nexport const mergeEvaluated: MergeEvaluated = {\n props: makeMergeEvaluated({\n mergeNames: (gen, from, to) =>\n gen.if(_`${to} !== true && ${from} !== undefined`, () => {\n gen.if(\n _`${from} === true`,\n () => gen.assign(to, true),\n () => gen.assign(to, _`${to} || {}`).code(_`Object.assign(${to}, ${from})`)\n )\n }),\n mergeToName: (gen, from, to) =>\n gen.if(_`${to} !== true`, () => {\n if (from === true) {\n gen.assign(to, true)\n } else {\n gen.assign(to, _`${to} || {}`)\n setEvaluated(gen, to, from)\n }\n }),\n mergeValues: (from, to) => (from === true ? true : {...from, ...to}),\n resultToName: evaluatedPropsToName,\n }),\n items: makeMergeEvaluated({\n mergeNames: (gen, from, to) =>\n gen.if(_`${to} !== true && ${from} !== undefined`, () =>\n gen.assign(to, _`${from} === true ? true : ${to} > ${from} ? ${to} : ${from}`)\n ),\n mergeToName: (gen, from, to) =>\n gen.if(_`${to} !== true`, () =>\n gen.assign(to, from === true ? true : _`${to} > ${from} ? ${to} : ${from}`)\n ),\n mergeValues: (from, to) => (from === true ? true : Math.max(from, to)),\n resultToName: (gen, items) => gen.var(\"items\", items),\n }),\n}\n\nexport function evaluatedPropsToName(gen: CodeGen, ps?: EvaluatedProperties): Name {\n if (ps === true) return gen.var(\"props\", true)\n const props = gen.var(\"props\", _`{}`)\n if (ps !== undefined) setEvaluated(gen, props, ps)\n return props\n}\n\nexport function setEvaluated(gen: CodeGen, props: Name, ps: {[K in string]?: true}): void {\n Object.keys(ps).forEach((p) => gen.assign(_`${props}${getProperty(p)}`, true))\n}\n\nconst snippets: {[S in string]?: _Code} = {}\n\nexport function useFunc(gen: CodeGen, f: {code: string}): Name {\n return gen.scopeValue(\"func\", {\n ref: f,\n code: snippets[f.code] || (snippets[f.code] = new _Code(f.code)),\n })\n}\n\nexport enum Type {\n Num,\n Str,\n}\n\nexport function getErrorPath(\n dataProp: Name | string | number,\n dataPropType?: Type,\n jsPropertySyntax?: boolean\n): Code | string {\n // let path\n if (dataProp instanceof Name) {\n const isNumber = dataPropType === Type.Num\n return jsPropertySyntax\n ? isNumber\n ? _`\"[\" + ${dataProp} + \"]\"`\n : _`\"['\" + ${dataProp} + \"']\"`\n : isNumber\n ? _`\"/\" + ${dataProp}`\n : _`\"/\" + ${dataProp}.replace(/~/g, \"~0\").replace(/\\\\//g, \"~1\")` // TODO maybe use global escapePointer\n }\n return jsPropertySyntax ? getProperty(dataProp).toString() : \"/\" + escapeJsonPointer(dataProp)\n}\n\nexport function checkStrictMode(\n it: SchemaCxt,\n msg: string,\n mode: boolean | \"log\" = it.opts.strictSchema\n): void {\n if (!mode) return\n msg = `strict mode: ${msg}`\n if (mode === true) throw new Error(msg)\n it.self.logger.warn(msg)\n}\n", "import {Name} from \"./codegen\"\n\nconst names = {\n // validation function arguments\n data: new Name(\"data\"), // data passed to validation function\n // args passed from referencing schema\n valCxt: new Name(\"valCxt\"), // validation/data context - should not be used directly, it is destructured to the names below\n instancePath: new Name(\"instancePath\"),\n parentData: new Name(\"parentData\"),\n parentDataProperty: new Name(\"parentDataProperty\"),\n rootData: new Name(\"rootData\"), // root data - same as the data passed to the first/top validation function\n dynamicAnchors: new Name(\"dynamicAnchors\"), // used to support recursiveRef and dynamicRef\n // function scoped variables\n vErrors: new Name(\"vErrors\"), // null or array of validation errors\n errors: new Name(\"errors\"), // counter of validation errors\n this: new Name(\"this\"),\n // \"globals\"\n self: new Name(\"self\"),\n scope: new Name(\"scope\"),\n // JTD serialize/parse name for JSON string and position\n json: new Name(\"json\"),\n jsonPos: new Name(\"jsonPos\"),\n jsonLen: new Name(\"jsonLen\"),\n jsonPart: new Name(\"jsonPart\"),\n}\n\nexport default names\n", "import type {KeywordErrorCxt, KeywordErrorDefinition} from \"../types\"\nimport type {SchemaCxt} from \"./index\"\nimport {CodeGen, _, str, strConcat, Code, Name} from \"./codegen\"\nimport {SafeExpr} from \"./codegen/code\"\nimport {getErrorPath, Type} from \"./util\"\nimport N from \"./names\"\n\nexport const keywordError: KeywordErrorDefinition = {\n message: ({keyword}) => str`must pass \"${keyword}\" keyword validation`,\n}\n\nexport const keyword$DataError: KeywordErrorDefinition = {\n message: ({keyword, schemaType}) =>\n schemaType\n ? str`\"${keyword}\" keyword must be ${schemaType} ($data)`\n : str`\"${keyword}\" keyword is invalid ($data)`,\n}\n\nexport interface ErrorPaths {\n instancePath?: Code\n schemaPath?: string\n parentSchema?: boolean\n}\n\nexport function reportError(\n cxt: KeywordErrorCxt,\n error: KeywordErrorDefinition = keywordError,\n errorPaths?: ErrorPaths,\n overrideAllErrors?: boolean\n): void {\n const {it} = cxt\n const {gen, compositeRule, allErrors} = it\n const errObj = errorObjectCode(cxt, error, errorPaths)\n if (overrideAllErrors ?? (compositeRule || allErrors)) {\n addError(gen, errObj)\n } else {\n returnErrors(it, _`[${errObj}]`)\n }\n}\n\nexport function reportExtraError(\n cxt: KeywordErrorCxt,\n error: KeywordErrorDefinition = keywordError,\n errorPaths?: ErrorPaths\n): void {\n const {it} = cxt\n const {gen, compositeRule, allErrors} = it\n const errObj = errorObjectCode(cxt, error, errorPaths)\n addError(gen, errObj)\n if (!(compositeRule || allErrors)) {\n returnErrors(it, N.vErrors)\n }\n}\n\nexport function resetErrorsCount(gen: CodeGen, errsCount: Name): void {\n gen.assign(N.errors, errsCount)\n gen.if(_`${N.vErrors} !== null`, () =>\n gen.if(\n errsCount,\n () => gen.assign(_`${N.vErrors}.length`, errsCount),\n () => gen.assign(N.vErrors, null)\n )\n )\n}\n\nexport function extendErrors({\n gen,\n keyword,\n schemaValue,\n data,\n errsCount,\n it,\n}: KeywordErrorCxt): void {\n /* istanbul ignore if */\n if (errsCount === undefined) throw new Error(\"ajv implementation error\")\n const err = gen.name(\"err\")\n gen.forRange(\"i\", errsCount, N.errors, (i) => {\n gen.const(err, _`${N.vErrors}[${i}]`)\n gen.if(_`${err}.instancePath === undefined`, () =>\n gen.assign(_`${err}.instancePath`, strConcat(N.instancePath, it.errorPath))\n )\n gen.assign(_`${err}.schemaPath`, str`${it.errSchemaPath}/${keyword}`)\n if (it.opts.verbose) {\n gen.assign(_`${err}.schema`, schemaValue)\n gen.assign(_`${err}.data`, data)\n }\n })\n}\n\nfunction addError(gen: CodeGen, errObj: Code): void {\n const err = gen.const(\"err\", errObj)\n gen.if(\n _`${N.vErrors} === null`,\n () => gen.assign(N.vErrors, _`[${err}]`),\n _`${N.vErrors}.push(${err})`\n )\n gen.code(_`${N.errors}++`)\n}\n\nfunction returnErrors(it: SchemaCxt, errs: Code): void {\n const {gen, validateName, schemaEnv} = it\n if (schemaEnv.$async) {\n gen.throw(_`new ${it.ValidationError as Name}(${errs})`)\n } else {\n gen.assign(_`${validateName}.errors`, errs)\n gen.return(false)\n }\n}\n\nconst E = {\n keyword: new Name(\"keyword\"),\n schemaPath: new Name(\"schemaPath\"), // also used in JTD errors\n params: new Name(\"params\"),\n propertyName: new Name(\"propertyName\"),\n message: new Name(\"message\"),\n schema: new Name(\"schema\"),\n parentSchema: new Name(\"parentSchema\"),\n}\n\nfunction errorObjectCode(\n cxt: KeywordErrorCxt,\n error: KeywordErrorDefinition,\n errorPaths?: ErrorPaths\n): Code {\n const {createErrors} = cxt.it\n if (createErrors === false) return _`{}`\n return errorObject(cxt, error, errorPaths)\n}\n\nfunction errorObject(\n cxt: KeywordErrorCxt,\n error: KeywordErrorDefinition,\n errorPaths: ErrorPaths = {}\n): Code {\n const {gen, it} = cxt\n const keyValues: [Name, SafeExpr | string][] = [\n errorInstancePath(it, errorPaths),\n errorSchemaPath(cxt, errorPaths),\n ]\n extraErrorProps(cxt, error, keyValues)\n return gen.object(...keyValues)\n}\n\nfunction errorInstancePath({errorPath}: SchemaCxt, {instancePath}: ErrorPaths): [Name, Code] {\n const instPath = instancePath\n ? str`${errorPath}${getErrorPath(instancePath, Type.Str)}`\n : errorPath\n return [N.instancePath, strConcat(N.instancePath, instPath)]\n}\n\nfunction errorSchemaPath(\n {keyword, it: {errSchemaPath}}: KeywordErrorCxt,\n {schemaPath, parentSchema}: ErrorPaths\n): [Name, string | Code] {\n let schPath = parentSchema ? errSchemaPath : str`${errSchemaPath}/${keyword}`\n if (schemaPath) {\n schPath = str`${schPath}${getErrorPath(schemaPath, Type.Str)}`\n }\n return [E.schemaPath, schPath]\n}\n\nfunction extraErrorProps(\n cxt: KeywordErrorCxt,\n {params, message}: KeywordErrorDefinition,\n keyValues: [Name, SafeExpr | string][]\n): void {\n const {keyword, data, schemaValue, it} = cxt\n const {opts, propertyName, topSchemaRef, schemaPath} = it\n keyValues.push(\n [E.keyword, keyword],\n [E.params, typeof params == \"function\" ? params(cxt) : params || _`{}`]\n )\n if (opts.messages) {\n keyValues.push([E.message, typeof message == \"function\" ? message(cxt) : message])\n }\n if (opts.verbose) {\n keyValues.push(\n [E.schema, schemaValue],\n [E.parentSchema, _`${topSchemaRef}${schemaPath}`],\n [N.data, data]\n )\n }\n if (propertyName) keyValues.push([E.propertyName, propertyName])\n}\n", "import type {KeywordErrorDefinition, KeywordErrorCxt} from \"../../types\"\nimport type {SchemaCxt} from \"..\"\nimport {reportError} from \"../errors\"\nimport {_, Name} from \"../codegen\"\nimport N from \"../names\"\n\nconst boolError: KeywordErrorDefinition = {\n message: \"boolean schema is false\",\n}\n\nexport function topBoolOrEmptySchema(it: SchemaCxt): void {\n const {gen, schema, validateName} = it\n if (schema === false) {\n falseSchemaError(it, false)\n } else if (typeof schema == \"object\" && schema.$async === true) {\n gen.return(N.data)\n } else {\n gen.assign(_`${validateName}.errors`, null)\n gen.return(true)\n }\n}\n\nexport function boolOrEmptySchema(it: SchemaCxt, valid: Name): void {\n const {gen, schema} = it\n if (schema === false) {\n gen.var(valid, false) // TODO var\n falseSchemaError(it)\n } else {\n gen.var(valid, true) // TODO var\n }\n}\n\nfunction falseSchemaError(it: SchemaCxt, overrideAllErrors?: boolean): void {\n const {gen, data} = it\n // TODO maybe some other interface should be used for non-keyword validation errors...\n const cxt: KeywordErrorCxt = {\n gen,\n keyword: \"false schema\",\n data,\n schema: false,\n schemaCode: false,\n schemaValue: false,\n params: {},\n it,\n }\n reportError(cxt, boolError, undefined, overrideAllErrors)\n}\n", "import type {AddedKeywordDefinition} from \"../types\"\n\nconst _jsonTypes = [\"string\", \"number\", \"integer\", \"boolean\", \"null\", \"object\", \"array\"] as const\n\nexport type JSONType = (typeof _jsonTypes)[number]\n\nconst jsonTypes: Set<string> = new Set(_jsonTypes)\n\nexport function isJSONType(x: unknown): x is JSONType {\n return typeof x == \"string\" && jsonTypes.has(x)\n}\n\ntype ValidationTypes = {\n [K in JSONType]: boolean | RuleGroup | undefined\n}\n\nexport interface ValidationRules {\n rules: RuleGroup[]\n post: RuleGroup\n all: {[Key in string]?: boolean | Rule} // rules that have to be validated\n keywords: {[Key in string]?: boolean} // all known keywords (superset of \"all\")\n types: ValidationTypes\n}\n\nexport interface RuleGroup {\n type?: JSONType\n rules: Rule[]\n}\n\n// This interface wraps KeywordDefinition because definition can have multiple keywords\nexport interface Rule {\n keyword: string\n definition: AddedKeywordDefinition\n}\n\nexport function getRules(): ValidationRules {\n const groups: Record<\"number\" | \"string\" | \"array\" | \"object\", RuleGroup> = {\n number: {type: \"number\", rules: []},\n string: {type: \"string\", rules: []},\n array: {type: \"array\", rules: []},\n object: {type: \"object\", rules: []},\n }\n return {\n types: {...groups, integer: true, boolean: true, null: true},\n rules: [{rules: []}, groups.number, groups.string, groups.array, groups.object],\n post: {rules: []},\n all: {},\n keywords: {},\n }\n}\n", "import type {AnySchemaObject} from \"../../types\"\nimport type {SchemaObjCxt} from \"..\"\nimport type {JSONType, RuleGroup, Rule} from \"../rules\"\n\nexport function schemaHasRulesForType(\n {schema, self}: SchemaObjCxt,\n type: JSONType\n): boolean | undefined {\n const group = self.RULES.types[type]\n return group && group !== true && shouldUseGroup(schema, group)\n}\n\nexport function shouldUseGroup(schema: AnySchemaObject, group: RuleGroup): boolean {\n return group.rules.some((rule) => shouldUseRule(schema, rule))\n}\n\nexport function shouldUseRule(schema: AnySchemaObject, rule: Rule): boolean | undefined {\n return (\n schema[rule.keyword] !== undefined ||\n rule.definition.implements?.some((kwd) => schema[kwd] !== undefined)\n )\n}\n", "import type {\n KeywordErrorDefinition,\n KeywordErrorCxt,\n ErrorObject,\n AnySchemaObject,\n} from \"../../types\"\nimport type {SchemaObjCxt} from \"..\"\nimport {isJSONType, JSONType} from \"../rules\"\nimport {schemaHasRulesForType} from \"./applicability\"\nimport {reportError} from \"../errors\"\nimport {_, nil, and, not, operators, Code, Name} from \"../codegen\"\nimport {toHash, schemaRefOrVal} from \"../util\"\n\nexport enum DataType {\n Correct,\n Wrong,\n}\n\nexport function getSchemaTypes(schema: AnySchemaObject): JSONType[] {\n const types = getJSONTypes(schema.type)\n const hasNull = types.includes(\"null\")\n if (hasNull) {\n if (schema.nullable === false) throw new Error(\"type: null contradicts nullable: false\")\n } else {\n if (!types.length && schema.nullable !== undefined) {\n throw new Error('\"nullable\" cannot be used without \"type\"')\n }\n if (schema.nullable === true) types.push(\"null\")\n }\n return types\n}\n\n// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\nexport function getJSONTypes(ts: unknown | unknown[]): JSONType[] {\n const types: unknown[] = Array.isArray(ts) ? ts : ts ? [ts] : []\n if (types.every(isJSONType)) return types\n throw new Error(\"type must be JSONType or JSONType[]: \" + types.join(\",\"))\n}\n\nexport function coerceAndCheckDataType(it: SchemaObjCxt, types: JSONType[]): boolean {\n const {gen, data, opts} = it\n const coerceTo = coerceToTypes(types, opts.coerceTypes)\n const checkTypes =\n types.length > 0 &&\n !(coerceTo.length === 0 && types.length === 1 && schemaHasRulesForType(it, types[0]))\n if (checkTypes) {\n const wrongType = checkDataTypes(types, data, opts.strictNumbers, DataType.Wrong)\n gen.if(wrongType, () => {\n if (coerceTo.length) coerceData(it, types, coerceTo)\n else reportTypeError(it)\n })\n }\n return checkTypes\n}\n\nconst COERCIBLE: Set<JSONType> = new Set([\"string\", \"number\", \"integer\", \"boolean\", \"null\"])\nfunction coerceToTypes(types: JSONType[], coerceTypes?: boolean | \"array\"): JSONType[] {\n return coerceTypes\n ? types.filter((t) => COERCIBLE.has(t) || (coerceTypes === \"array\" && t === \"array\"))\n : []\n}\n\nfunction coerceData(it: SchemaObjCxt, types: JSONType[], coerceTo: JSONType[]): void {\n const {gen, data, opts} = it\n const dataType = gen.let(\"dataType\", _`typeof ${data}`)\n const coerced = gen.let(\"coerced\", _`undefined`)\n if (opts.coerceTypes === \"array\") {\n gen.if(_`${dataType} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () =>\n gen\n .assign(data, _`${data}[0]`)\n .assign(dataType, _`typeof ${data}`)\n .if(checkDataTypes(types, data, opts.strictNumbers), () => gen.assign(coerced, data))\n )\n }\n gen.if(_`${coerced} !== undefined`)\n for (const t of coerceTo) {\n if (COERCIBLE.has(t) || (t === \"array\" && opts.coerceTypes === \"array\")) {\n coerceSpecificType(t)\n }\n }\n gen.else()\n reportTypeError(it)\n gen.endIf()\n\n gen.if(_`${coerced} !== undefined`, () => {\n gen.assign(data, coerced)\n assignParentData(it, coerced)\n })\n\n function coerceSpecificType(t: string): void {\n switch (t) {\n case \"string\":\n gen\n .elseIf(_`${dataType} == \"number\" || ${dataType} == \"boolean\"`)\n .assign(coerced, _`\"\" + ${data}`)\n .elseIf(_`${data} === null`)\n .assign(coerced, _`\"\"`)\n return\n case \"number\":\n gen\n .elseIf(\n _`${dataType} == \"boolean\" || ${data} === null\n || (${dataType} == \"string\" && ${data} && ${data} == +${data})`\n )\n .assign(coerced, _`+${data}`)\n return\n case \"integer\":\n gen\n .elseIf(\n _`${dataType} === \"boolean\" || ${data} === null\n || (${dataType} === \"string\" && ${data} && ${data} == +${data} && !(${data} % 1))`\n )\n .assign(coerced, _`+${data}`)\n return\n case \"boolean\":\n gen\n .elseIf(_`${data} === \"false\" || ${data} === 0 || ${data} === null`)\n .assign(coerced, false)\n .elseIf(_`${data} === \"true\" || ${data} === 1`)\n .assign(coerced, true)\n return\n case \"null\":\n gen.elseIf(_`${data} === \"\" || ${data} === 0 || ${data} === false`)\n gen.assign(coerced, null)\n return\n\n case \"array\":\n gen\n .elseIf(\n _`${dataType} === \"string\" || ${dataType} === \"number\"\n || ${dataType} === \"boolean\" || ${data} === null`\n )\n .assign(coerced, _`[${data}]`)\n }\n }\n}\n\nfunction assignParentData({gen, parentData, parentDataProperty}: SchemaObjCxt, expr: Name): void {\n // TODO use gen.property\n gen.if(_`${parentData} !== undefined`, () =>\n gen.assign(_`${parentData}[${parentDataProperty}]`, expr)\n )\n}\n\nexport function checkDataType(\n dataType: JSONType,\n data: Name,\n strictNums?: boolean | \"log\",\n correct = DataType.Correct\n): Code {\n const EQ = correct === DataType.Correct ? operators.EQ : operators.NEQ\n let cond: Code\n switch (dataType) {\n case \"null\":\n return _`${data} ${EQ} null`\n case \"array\":\n cond = _`Array.isArray(${data})`\n break\n case \"object\":\n cond = _`${data} && typeof ${data} == \"object\" && !Array.isArray(${data})`\n break\n case \"integer\":\n cond = numCond(_`!(${data} % 1) && !isNaN(${data})`)\n break\n case \"number\":\n cond = numCond()\n break\n default:\n return _`typeof ${data} ${EQ} ${dataType}`\n }\n return correct === DataType.Correct ? cond : not(cond)\n\n function numCond(_cond: Code = nil): Code {\n return and(_`typeof ${data} == \"number\"`, _cond, strictNums ? _`isFinite(${data})` : nil)\n }\n}\n\nexport function checkDataTypes(\n dataTypes: JSONType[],\n data: Name,\n strictNums?: boolean | \"log\",\n correct?: DataType\n): Code {\n if (dataTypes.length === 1) {\n return checkDataType(dataTypes[0], data, strictNums, correct)\n }\n let cond: Code\n const types = toHash(dataTypes)\n if (types.array && types.object) {\n const notObj = _`typeof ${data} != \"object\"`\n cond = types.null ? notObj : _`!${data} || ${notObj}`\n delete types.null\n delete types.array\n delete types.object\n } else {\n cond = nil\n }\n if (types.number) delete types.integer\n for (const t in types) cond = and(cond, checkDataType(t as JSONType, data, strictNums, correct))\n return cond\n}\n\nexport type TypeError = ErrorObject<\"type\", {type: string}>\n\nconst typeError: KeywordErrorDefinition = {\n message: ({schema}) => `must be ${schema}`,\n params: ({schema, schemaValue}) =>\n typeof schema == \"string\" ? _`{type: ${schema}}` : _`{type: ${schemaValue}}`,\n}\n\nexport function reportTypeError(it: SchemaObjCxt): void {\n const cxt = getTypeErrorContext(it)\n reportError(cxt, typeError)\n}\n\nfunction getTypeErrorContext(it: SchemaObjCxt): KeywordErrorCxt {\n const {gen, data, schema} = it\n const schemaCode = schemaRefOrVal(it, schema, \"type\")\n return {\n gen,\n keyword: \"type\",\n data,\n schema: schema.type,\n schemaCode,\n schemaValue: schemaCode,\n parentSchema: schema,\n params: {},\n it,\n }\n}\n", "import type {SchemaObjCxt} from \"..\"\nimport {_, getProperty, stringify} from \"../codegen\"\nimport {checkStrictMode} from \"../util\"\n\nexport function assignDefaults(it: SchemaObjCxt, ty?: string): void {\n const {properties, items} = it.schema\n if (ty === \"object\" && properties) {\n for (const key in properties) {\n assignDefault(it, key, properties[key].default)\n }\n } else if (ty === \"array\" && Array.isArray(items)) {\n items.forEach((sch, i: number) => assignDefault(it, i, sch.default))\n }\n}\n\nfunction assignDefault(it: SchemaObjCxt, prop: string | number, defaultValue: unknown): void {\n const {gen, compositeRule, data, opts} = it\n if (defaultValue === undefined) return\n const childData = _`${data}${getProperty(prop)}`\n if (compositeRule) {\n checkStrictMode(it, `default is ignored for: ${childData}`)\n return\n }\n\n let condition = _`${childData} === undefined`\n if (opts.useDefaults === \"empty\") {\n condition = _`${condition} || ${childData} === null || ${childData} === \"\"`\n }\n // `${childData} === undefined` +\n // (opts.useDefaults === \"empty\" ? ` || ${childData} === null || ${childData} === \"\"` : \"\")\n gen.if(condition, _`${childData} = ${stringify(defaultValue)}`)\n}\n", "import type {AnySchema, SchemaMap} from \"../types\"\nimport type {SchemaCxt} from \"../compile\"\nimport type {KeywordCxt} from \"../compile/validate\"\nimport {CodeGen, _, and, or, not, nil, strConcat, getProperty, Code, Name} from \"../compile/codegen\"\nimport {alwaysValidSchema, Type} from \"../compile/util\"\nimport N from \"../compile/names\"\nimport {useFunc} from \"../compile/util\"\nexport function checkReportMissingProp(cxt: KeywordCxt, prop: string): void {\n const {gen, data, it} = cxt\n gen.if(noPropertyInData(gen, data, prop, it.opts.ownProperties), () => {\n cxt.setParams({missingProperty: _`${prop}`}, true)\n cxt.error()\n })\n}\n\nexport function checkMissingProp(\n {gen, data, it: {opts}}: KeywordCxt,\n properties: string[],\n missing: Name\n): Code {\n return or(\n ...properties.map((prop) =>\n and(noPropertyInData(gen, data, prop, opts.ownProperties), _`${missing} = ${prop}`)\n )\n )\n}\n\nexport function reportMissingProp(cxt: KeywordCxt, missing: Name): void {\n cxt.setParams({missingProperty: missing}, true)\n cxt.error()\n}\n\nexport function hasPropFunc(gen: CodeGen): Name {\n return gen.scopeValue(\"func\", {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n ref: Object.prototype.hasOwnProperty,\n code: _`Object.prototype.hasOwnProperty`,\n })\n}\n\nexport function isOwnProperty(gen: CodeGen, data: Name, property: Name | string): Code {\n return _`${hasPropFunc(gen)}.call(${data}, ${property})`\n}\n\nexport function propertyInData(\n gen: CodeGen,\n data: Name,\n property: Name | string,\n ownProperties?: boolean\n): Code {\n const cond = _`${data}${getProperty(property)} !== undefined`\n return ownProperties ? _`${cond} && ${isOwnProperty(gen, data, property)}` : cond\n}\n\nexport function noPropertyInData(\n gen: CodeGen,\n data: Name,\n property: Name | string,\n ownProperties?: boolean\n): Code {\n const cond = _`${data}${getProperty(property)} === undefined`\n return ownProperties ? or(cond, not(isOwnProperty(gen, data, property))) : cond\n}\n\nexport function allSchemaProperties(schemaMap?: SchemaMap): string[] {\n return schemaMap ? Object.keys(schemaMap).filter((p) => p !== \"__proto__\") : []\n}\n\nexport function schemaProperties(it: SchemaCxt, schemaMap: SchemaMap): string[] {\n return allSchemaProperties(schemaMap).filter(\n (p) => !alwaysValidSchema(it, schemaMap[p] as AnySchema)\n )\n}\n\nexport function callValidateCode(\n {schemaCode, data, it: {gen, topSchemaRef, schemaPath, errorPath}, it}: KeywordCxt,\n func: Code,\n context: Code,\n passSchema?: boolean\n): Code {\n const dataAndSchema = passSchema ? _`${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data\n const valCxt: [Name, Code | number][] = [\n [N.instancePath, strConcat(N.instancePath, errorPath)],\n [N.parentData, it.parentData],\n [N.parentDataProperty, it.parentDataProperty],\n [N.rootData, N.rootData],\n ]\n if (it.opts.dynamicRef) valCxt.push([N.dynamicAnchors, N.dynamicAnchors])\n const args = _`${dataAndSchema}, ${gen.object(...valCxt)}`\n return context !== nil ? _`${func}.call(${context}, ${args})` : _`${func}(${args})`\n}\n\nconst newRegExp = _`new RegExp`\n\nexport function usePattern({gen, it: {opts}}: KeywordCxt, pattern: string): Name {\n const u = opts.unicodeRegExp ? \"u\" : \"\"\n const {regExp} = opts.code\n const rx = regExp(pattern, u)\n\n return gen.scopeValue(\"pattern\", {\n key: rx.toString(),\n ref: rx,\n code: _`${regExp.code === \"new RegExp\" ? newRegExp : useFunc(gen, regExp)}(${pattern}, ${u})`,\n })\n}\n\nexport function validateArray(cxt: KeywordCxt): Name {\n const {gen, data, keyword, it} = cxt\n const valid = gen.name(\"valid\")\n if (it.allErrors) {\n const validArr = gen.let(\"valid\", true)\n validateItems(() => gen.assign(validArr, false))\n return validArr\n }\n gen.var(valid, true)\n validateItems(() => gen.break())\n return valid\n\n function validateItems(notValid: () => void): void {\n const len = gen.const(\"len\", _`${data}.length`)\n gen.forRange(\"i\", 0, len, (i) => {\n cxt.subschema(\n {\n keyword,\n dataProp: i,\n dataPropType: Type.Num,\n },\n valid\n )\n gen.if(not(valid), notValid)\n })\n }\n}\n\nexport function validateUnion(cxt: KeywordCxt): void {\n const {gen, schema, keyword, it} = cxt\n /* istanbul ignore if */\n if (!Array.isArray(schema)) throw new Error(\"ajv implementation error\")\n const alwaysValid = schema.some((sch: AnySchema) => alwaysValidSchema(it, sch))\n if (alwaysValid && !it.opts.unevaluated) return\n\n const valid = gen.let(\"valid\", false)\n const schValid = gen.name(\"_valid\")\n\n gen.block(() =>\n schema.forEach((_sch: AnySchema, i: number) => {\n const schCxt = cxt.subschema(\n {\n keyword,\n schemaProp: i,\n compositeRule: true,\n },\n schValid\n )\n gen.assign(valid, _`${valid} || ${schValid}`)\n const merged = cxt.mergeValidEvaluated(schCxt, schValid)\n // can short-circuit if `unevaluatedProperties/Items` not supported (opts.unevaluated !== true)\n // or if all properties and items were evaluated (it.props === true && it.items === true)\n if (!merged) gen.if(not(valid))\n })\n )\n\n cxt.result(\n valid,\n () => cxt.reset(),\n () => cxt.error(true)\n )\n}\n", "import type {KeywordCxt} from \".\"\nimport type {\n AnySchema,\n SchemaValidateFunction,\n AnyValidateFunction,\n AddedKeywordDefinition,\n MacroKeywordDefinition,\n FuncKeywordDefinition,\n} from \"../../types\"\nimport type {SchemaObjCxt} from \"..\"\nimport {_, nil, not, stringify, Code, Name, CodeGen} from \"../codegen\"\nimport N from \"../names\"\nimport type {JSONType} from \"../rules\"\nimport {callValidateCode} from \"../../vocabularies/code\"\nimport {extendErrors} from \"../errors\"\n\ntype KeywordCompilationResult = AnySchema | SchemaValidateFunction | AnyValidateFunction\n\nexport function macroKeywordCode(cxt: KeywordCxt, def: MacroKeywordDefinition): void {\n const {gen, keyword, schema, parentSchema, it} = cxt\n const macroSchema = def.macro.call(it.self, schema, parentSchema, it)\n const schemaRef = useKeyword(gen, keyword, macroSchema)\n if (it.opts.validateSchema !== false) it.self.validateSchema(macroSchema, true)\n\n const valid = gen.name(\"valid\")\n cxt.subschema(\n {\n schema: macroSchema,\n schemaPath: nil,\n errSchemaPath: `${it.errSchemaPath}/${keyword}`,\n topSchemaRef: schemaRef,\n compositeRule: true,\n },\n valid\n )\n cxt.pass(valid, () => cxt.error(true))\n}\n\nexport function funcKeywordCode(cxt: KeywordCxt, def: FuncKeywordDefinition): void {\n const {gen, keyword, schema, parentSchema, $data, it} = cxt\n checkAsyncKeyword(it, def)\n const validate =\n !$data && def.compile ? def.compile.call(it.self, schema, parentSchema, it) : def.validate\n const validateRef = useKeyword(gen, keyword, validate)\n const valid = gen.let(\"valid\")\n cxt.block$data(valid, validateKeyword)\n cxt.ok(def.valid ?? valid)\n\n function validateKeyword(): void {\n if (def.errors === false) {\n assignValid()\n if (def.modifying) modifyData(cxt)\n reportErrs(() => cxt.error())\n } else {\n const ruleErrs = def.async ? validateAsync() : validateSync()\n if (def.modifying) modifyData(cxt)\n reportErrs(() => addErrs(cxt, ruleErrs))\n }\n }\n\n function validateAsync(): Name {\n const ruleErrs = gen.let(\"ruleErrs\", null)\n gen.try(\n () => assignValid(_`await `),\n (e) =>\n gen.assign(valid, false).if(\n _`${e} instanceof ${it.ValidationError as Name}`,\n () => gen.assign(ruleErrs, _`${e}.errors`),\n () => gen.throw(e)\n )\n )\n return ruleErrs\n }\n\n function validateSync(): Code {\n const validateErrs = _`${validateRef}.errors`\n gen.assign(validateErrs, null)\n assignValid(nil)\n return validateErrs\n }\n\n function assignValid(_await: Code = def.async ? _`await ` : nil): void {\n const passCxt = it.opts.passContext ? N.this : N.self\n const passSchema = !((\"compile\" in def && !$data) || def.schema === false)\n gen.assign(\n valid,\n _`${_await}${callValidateCode(cxt, validateRef, passCxt, passSchema)}`,\n def.modifying\n )\n }\n\n function reportErrs(errors: () => void): void {\n gen.if(not(def.valid ?? valid), errors)\n }\n}\n\nfunction modifyData(cxt: KeywordCxt): void {\n const {gen, data, it} = cxt\n gen.if(it.parentData, () => gen.assign(data, _`${it.parentData}[${it.parentDataProperty}]`))\n}\n\nfunction addErrs(cxt: KeywordCxt, errs: Code): void {\n const {gen} = cxt\n gen.if(\n _`Array.isArray(${errs})`,\n () => {\n gen\n .assign(N.vErrors, _`${N.vErrors} === null ? ${errs} : ${N.vErrors}.concat(${errs})`)\n .assign(N.errors, _`${N.vErrors}.length`)\n extendErrors(cxt)\n },\n () => cxt.error()\n )\n}\n\nfunction checkAsyncKeyword({schemaEnv}: SchemaObjCxt, def: FuncKeywordDefinition): void {\n if (def.async && !schemaEnv.$async) throw new Error(\"async keyword in sync schema\")\n}\n\nfunction useKeyword(gen: CodeGen, keyword: string, result?: KeywordCompilationResult): Name {\n if (result === undefined) throw new Error(`keyword \"${keyword}\" failed to compile`)\n return gen.scopeValue(\n \"keyword\",\n typeof result == \"function\" ? {ref: result} : {ref: result, code: stringify(result)}\n )\n}\n\nexport function validSchemaType(\n schema: unknown,\n schemaType: JSONType[],\n allowUndefined = false\n): boolean {\n // TODO add tests\n return (\n !schemaType.length ||\n schemaType.some((st) =>\n st === \"array\"\n ? Array.isArray(schema)\n : st === \"object\"\n ? schema && typeof schema == \"object\" && !Array.isArray(schema)\n : typeof schema == st || (allowUndefined && typeof schema == \"undefined\")\n )\n )\n}\n\nexport function validateKeywordUsage(\n {schema, opts, self, errSchemaPath}: SchemaObjCxt,\n def: AddedKeywordDefinition,\n keyword: string\n): void {\n /* istanbul ignore if */\n if (Array.isArray(def.keyword) ? !def.keyword.includes(keyword) : def.keyword !== keyword) {\n throw new Error(\"ajv implementation error\")\n }\n\n const deps = def.dependencies\n if (deps?.some((kwd) => !Object.prototype.hasOwnProperty.call(schema, kwd))) {\n throw new Error(`parent schema must have dependencies of ${keyword}: ${deps.join(\",\")}`)\n }\n\n if (def.validateSchema) {\n const valid = def.validateSchema(schema[keyword])\n if (!valid) {\n const msg =\n `keyword \"${keyword}\" value is invalid at path \"${errSchemaPath}\": ` +\n self.errorsText(def.validateSchema.errors)\n if (opts.validateSchema === \"log\") self.logger.error(msg)\n else throw new Error(msg)\n }\n }\n}\n", "import type {AnySchema} from \"../../types\"\nimport type {SchemaObjCxt} from \"..\"\nimport {_, str, getProperty, Code, Name} from \"../codegen\"\nimport {escapeFragment, getErrorPath, Type} from \"../util\"\nimport type {JSONType} from \"../rules\"\n\nexport interface SubschemaContext {\n // TODO use Optional? align with SchemCxt property types\n schema: AnySchema\n schemaPath: Code\n errSchemaPath: string\n topSchemaRef?: Code\n errorPath?: Code\n dataLevel?: number\n dataTypes?: JSONType[]\n data?: Name\n parentData?: Name\n parentDataProperty?: Code | number\n dataNames?: Name[]\n dataPathArr?: (Code | number)[]\n propertyName?: Name\n jtdDiscriminator?: string\n jtdMetadata?: boolean\n compositeRule?: true\n createErrors?: boolean\n allErrors?: boolean\n}\n\nexport type SubschemaArgs = Partial<{\n keyword: string\n schemaProp: string | number\n schema: AnySchema\n schemaPath: Code\n errSchemaPath: string\n topSchemaRef: Code\n data: Name | Code\n dataProp: Code | string | number\n dataTypes: JSONType[]\n definedProperties: Set<string>\n propertyName: Name\n dataPropType: Type\n jtdDiscriminator: string\n jtdMetadata: boolean\n compositeRule: true\n createErrors: boolean\n allErrors: boolean\n}>\n\nexport function getSubschema(\n it: SchemaObjCxt,\n {keyword, schemaProp, schema, schemaPath, errSchemaPath, topSchemaRef}: SubschemaArgs\n): SubschemaContext {\n if (keyword !== undefined && schema !== undefined) {\n throw new Error('both \"keyword\" and \"schema\" passed, only one allowed')\n }\n\n if (keyword !== undefined) {\n const sch = it.schema[keyword]\n return schemaProp === undefined\n ? {\n schema: sch,\n schemaPath: _`${it.schemaPath}${getProperty(keyword)}`,\n errSchemaPath: `${it.errSchemaPath}/${keyword}`,\n }\n : {\n schema: sch[schemaProp],\n schemaPath: _`${it.schemaPath}${getProperty(keyword)}${getProperty(schemaProp)}`,\n errSchemaPath: `${it.errSchemaPath}/${keyword}/${escapeFragment(schemaProp)}`,\n }\n }\n\n if (schema !== undefined) {\n if (schemaPath === undefined || errSchemaPath === undefined || topSchemaRef === undefined) {\n throw new Error('\"schemaPath\", \"errSchemaPath\" and \"topSchemaRef\" are required with \"schema\"')\n }\n return {\n schema,\n schemaPath,\n topSchemaRef,\n errSchemaPath,\n }\n }\n\n throw new Error('either \"keyword\" or \"schema\" must be passed')\n}\n\nexport function extendSubschemaData(\n subschema: SubschemaContext,\n it: SchemaObjCxt,\n {dataProp, dataPropType: dpType, data, dataTypes, propertyName}: SubschemaArgs\n): void {\n if (data !== undefined && dataProp !== undefined) {\n throw new Error('both \"data\" and \"dataProp\" passed, only one allowed')\n }\n\n const {gen} = it\n\n if (dataProp !== undefined) {\n const {errorPath, dataPathArr, opts} = it\n const nextData = gen.let(\"data\", _`${it.data}${getProperty(dataProp)}`, true)\n dataContextProps(nextData)\n subschema.errorPath = str`${errorPath}${getErrorPath(dataProp, dpType, opts.jsPropertySyntax)}`\n subschema.parentDataProperty = _`${dataProp}`\n subschema.dataPathArr = [...dataPathArr, subschema.parentDataProperty]\n }\n\n if (data !== undefined) {\n const nextData = data instanceof Name ? data : gen.let(\"data\", data, true) // replaceable if used once?\n dataContextProps(nextData)\n if (propertyName !== undefined) subschema.propertyName = propertyName\n // TODO something is possibly wrong here with not changing parentDataProperty and not appending dataPathArr\n }\n\n if (dataTypes) subschema.dataTypes = dataTypes\n\n function dataContextProps(_nextData: Name): void {\n subschema.data = _nextData\n subschema.dataLevel = it.dataLevel + 1\n subschema.dataTypes = []\n it.definedProperties = new Set<string>()\n subschema.parentData = it.data\n subschema.dataNames = [...it.dataNames, _nextData]\n }\n}\n\nexport function extendSubschemaMode(\n subschema: SubschemaContext,\n {jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors}: SubschemaArgs\n): void {\n if (compositeRule !== undefined) subschema.compositeRule = compositeRule\n if (createErrors !== undefined) subschema.createErrors = createErrors\n if (allErrors !== undefined) subschema.allErrors = allErrors\n subschema.jtdDiscriminator = jtdDiscriminator // not inherited\n subschema.jtdMetadata = jtdMetadata // not inherited\n}\n", "'use strict';\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n", "'use strict';\n\nvar traverse = module.exports = function (schema, opts, cb) {\n // Legacy support for v0.3.1 and earlier.\n if (typeof opts == 'function') {\n cb = opts;\n opts = {};\n }\n\n cb = opts.cb || cb;\n var pre = (typeof cb == 'function') ? cb : cb.pre || function() {};\n var post = cb.post || function() {};\n\n _traverse(opts, pre, post, schema, '', schema);\n};\n\n\ntraverse.keywords = {\n additionalItems: true,\n items: true,\n contains: true,\n additionalProperties: true,\n propertyNames: true,\n not: true,\n if: true,\n then: true,\n else: true\n};\n\ntraverse.arrayKeywords = {\n items: true,\n allOf: true,\n anyOf: true,\n oneOf: true\n};\n\ntraverse.propsKeywords = {\n $defs: true,\n definitions: true,\n properties: true,\n patternProperties: true,\n dependencies: true\n};\n\ntraverse.skipKeywords = {\n default: true,\n enum: true,\n const: true,\n required: true,\n maximum: true,\n minimum: true,\n exclusiveMaximum: true,\n exclusiveMinimum: true,\n multipleOf: true,\n maxLength: true,\n minLength: true,\n pattern: true,\n format: true,\n maxItems: true,\n minItems: true,\n uniqueItems: true,\n maxProperties: true,\n minProperties: true\n};\n\n\nfunction _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {\n if (schema && typeof schema == 'object' && !Array.isArray(schema)) {\n pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);\n for (var key in schema) {\n var sch = schema[key];\n if (Array.isArray(sch)) {\n if (key in traverse.arrayKeywords) {\n for (var i=0; i<sch.length; i++)\n _traverse(opts, pre, post, sch[i], jsonPtr + '/' + key + '/' + i, rootSchema, jsonPtr, key, schema, i);\n }\n } else if (key in traverse.propsKeywords) {\n if (sch && typeof sch == 'object') {\n for (var prop in sch)\n _traverse(opts, pre, post, sch[prop], jsonPtr + '/' + key + '/' + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema, prop);\n }\n } else if (key in traverse.keywords || (opts.allKeys && !(key in traverse.skipKeywords))) {\n _traverse(opts, pre, post, sch, jsonPtr + '/' + key, rootSchema, jsonPtr, key, schema);\n }\n }\n post(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);\n }\n}\n\n\nfunction escapeJsonPtr(str) {\n return str.replace(/~/g, '~0').replace(/\\//g, '~1');\n}\n", "import type {AnySchema, AnySchemaObject, UriResolver} from \"../types\"\nimport type Ajv from \"../ajv\"\nimport type {URIComponent} from \"fast-uri\"\nimport {eachItem} from \"./util\"\nimport * as equal from \"fast-deep-equal\"\nimport * as traverse from \"json-schema-traverse\"\n\n// the hash of local references inside the schema (created by getSchemaRefs), used for inline resolution\nexport type LocalRefs = {[Ref in string]?: AnySchemaObject}\n\n// TODO refactor to use keyword definitions\nconst SIMPLE_INLINED = new Set([\n \"type\",\n \"format\",\n \"pattern\",\n \"maxLength\",\n \"minLength\",\n \"maxProperties\",\n \"minProperties\",\n \"maxItems\",\n \"minItems\",\n \"maximum\",\n \"minimum\",\n \"uniqueItems\",\n \"multipleOf\",\n \"required\",\n \"enum\",\n \"const\",\n])\n\nexport function inlineRef(schema: AnySchema, limit: boolean | number = true): boolean {\n if (typeof schema == \"boolean\") return true\n if (limit === true) return !hasRef(schema)\n if (!limit) return false\n return countKeys(schema) <= limit\n}\n\nconst REF_KEYWORDS = new Set([\n \"$ref\",\n \"$recursiveRef\",\n \"$recursiveAnchor\",\n \"$dynamicRef\",\n \"$dynamicAnchor\",\n])\n\nfunction hasRef(schema: AnySchemaObject): boolean {\n for (const key in schema) {\n if (REF_KEYWORDS.has(key)) return true\n const sch = schema[key]\n if (Array.isArray(sch) && sch.some(hasRef)) return true\n if (typeof sch == \"object\" && hasRef(sch)) return true\n }\n return false\n}\n\nfunction countKeys(schema: AnySchemaObject): number {\n let count = 0\n for (const key in schema) {\n if (key === \"$ref\") return Infinity\n count++\n if (SIMPLE_INLINED.has(key)) continue\n if (typeof schema[key] == \"object\") {\n eachItem(schema[key], (sch) => (count += countKeys(sch)))\n }\n if (count === Infinity) return Infinity\n }\n return count\n}\n\nexport function getFullPath(resolver: UriResolver, id = \"\", normalize?: boolean): string {\n if (normalize !== false) id = normalizeId(id)\n const p = resolver.parse(id)\n return _getFullPath(resolver, p)\n}\n\nexport function _getFullPath(resolver: UriResolver, p: URIComponent): string {\n const serialized = resolver.serialize(p)\n return serialized.split(\"#\")[0] + \"#\"\n}\n\nconst TRAILING_SLASH_HASH = /#\\/?$/\nexport function normalizeId(id: string | undefined): string {\n return id ? id.replace(TRAILING_SLASH_HASH, \"\") : \"\"\n}\n\nexport function resolveUrl(resolver: UriResolver, baseId: string, id: string): string {\n id = normalizeId(id)\n return resolver.resolve(baseId, id)\n}\n\nconst ANCHOR = /^[a-z_][-a-z0-9._]*$/i\n\nexport function getSchemaRefs(this: Ajv, schema: AnySchema, baseId: string): LocalRefs {\n if (typeof schema == \"boolean\") return {}\n const {schemaId, uriResolver} = this.opts\n const schId = normalizeId(schema[schemaId] || baseId)\n const baseIds: {[JsonPtr in string]?: string} = {\"\": schId}\n const pathPrefix = getFullPath(uriResolver, schId, false)\n const localRefs: LocalRefs = {}\n const schemaRefs: Set<string> = new Set()\n\n traverse(schema, {allKeys: true}, (sch, jsonPtr, _, parentJsonPtr) => {\n if (parentJsonPtr === undefined) return\n const fullPath = pathPrefix + jsonPtr\n let innerBaseId = baseIds[parentJsonPtr]\n if (typeof sch[schemaId] == \"string\") innerBaseId = addRef.call(this, sch[schemaId])\n addAnchor.call(this, sch.$anchor)\n addAnchor.call(this, sch.$dynamicAnchor)\n baseIds[jsonPtr] = innerBaseId\n\n function addRef(this: Ajv, ref: string): string {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const _resolve = this.opts.uriResolver.resolve\n ref = normalizeId(innerBaseId ? _resolve(innerBaseId, ref) : ref)\n if (schemaRefs.has(ref)) throw ambiguos(ref)\n schemaRefs.add(ref)\n let schOrRef = this.refs[ref]\n if (typeof schOrRef == \"string\") schOrRef = this.refs[schOrRef]\n if (typeof schOrRef == \"object\") {\n checkAmbiguosRef(sch, schOrRef.schema, ref)\n } else if (ref !== normalizeId(fullPath)) {\n if (ref[0] === \"#\") {\n checkAmbiguosRef(sch, localRefs[ref], ref)\n localRefs[ref] = sch\n } else {\n this.refs[ref] = fullPath\n }\n }\n return ref\n }\n\n function addAnchor(this: Ajv, anchor: unknown): void {\n if (typeof anchor == \"string\") {\n if (!ANCHOR.test(anchor)) throw new Error(`invalid anchor \"${anchor}\"`)\n addRef.call(this, `#${anchor}`)\n }\n }\n })\n\n return localRefs\n\n function checkAmbiguosRef(sch1: AnySchema, sch2: AnySchema | undefined, ref: string): void {\n if (sch2 !== undefined && !equal(sch1, sch2)) throw ambiguos(ref)\n }\n\n function ambiguos(ref: string): Error {\n return new Error(`reference \"${ref}\" resolves to more than one schema`)\n }\n}\n", "import type {\n AddedKeywordDefinition,\n AnySchema,\n AnySchemaObject,\n KeywordErrorCxt,\n KeywordCxtParams,\n} from \"../../types\"\nimport type {SchemaCxt, SchemaObjCxt} from \"..\"\nimport type {InstanceOptions} from \"../../core\"\nimport {boolOrEmptySchema, topBoolOrEmptySchema} from \"./boolSchema\"\nimport {coerceAndCheckDataType, getSchemaTypes} from \"./dataType\"\nimport {shouldUseGroup, shouldUseRule} from \"./applicability\"\nimport {checkDataType, checkDataTypes, reportTypeError, DataType} from \"./dataType\"\nimport {assignDefaults} from \"./defaults\"\nimport {funcKeywordCode, macroKeywordCode, validateKeywordUsage, validSchemaType} from \"./keyword\"\nimport {getSubschema, extendSubschemaData, SubschemaArgs, extendSubschemaMode} from \"./subschema\"\nimport {_, nil, str, or, not, getProperty, Block, Code, Name, CodeGen} from \"../codegen\"\nimport N from \"../names\"\nimport {resolveUrl} from \"../resolve\"\nimport {\n schemaRefOrVal,\n schemaHasRulesButRef,\n checkUnknownRules,\n checkStrictMode,\n unescapeJsonPointer,\n mergeEvaluated,\n} from \"../util\"\nimport type {JSONType, Rule, RuleGroup} from \"../rules\"\nimport {\n ErrorPaths,\n reportError,\n reportExtraError,\n resetErrorsCount,\n keyword$DataError,\n} from \"../errors\"\n\n// schema compilation - generates validation function, subschemaCode (below) is used for subschemas\nexport function validateFunctionCode(it: SchemaCxt): void {\n if (isSchemaObj(it)) {\n checkKeywords(it)\n if (schemaCxtHasRules(it)) {\n topSchemaObjCode(it)\n return\n }\n }\n validateFunction(it, () => topBoolOrEmptySchema(it))\n}\n\nfunction validateFunction(\n {gen, validateName, schema, schemaEnv, opts}: SchemaCxt,\n body: Block\n): void {\n if (opts.code.es5) {\n gen.func(validateName, _`${N.data}, ${N.valCxt}`, schemaEnv.$async, () => {\n gen.code(_`\"use strict\"; ${funcSourceUrl(schema, opts)}`)\n destructureValCxtES5(gen, opts)\n gen.code(body)\n })\n } else {\n gen.func(validateName, _`${N.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () =>\n gen.code(funcSourceUrl(schema, opts)).code(body)\n )\n }\n}\n\nfunction destructureValCxt(opts: InstanceOptions): Code {\n return _`{${N.instancePath}=\"\", ${N.parentData}, ${N.parentDataProperty}, ${N.rootData}=${\n N.data\n }${opts.dynamicRef ? _`, ${N.dynamicAnchors}={}` : nil}}={}`\n}\n\nfunction destructureValCxtES5(gen: CodeGen, opts: InstanceOptions): void {\n gen.if(\n N.valCxt,\n () => {\n gen.var(N.instancePath, _`${N.valCxt}.${N.instancePath}`)\n gen.var(N.parentData, _`${N.valCxt}.${N.parentData}`)\n gen.var(N.parentDataProperty, _`${N.valCxt}.${N.parentDataProperty}`)\n gen.var(N.rootData, _`${N.valCxt}.${N.rootData}`)\n if (opts.dynamicRef) gen.var(N.dynamicAnchors, _`${N.valCxt}.${N.dynamicAnchors}`)\n },\n () => {\n gen.var(N.instancePath, _`\"\"`)\n gen.var(N.parentData, _`undefined`)\n gen.var(N.parentDataProperty, _`undefined`)\n gen.var(N.rootData, N.data)\n if (opts.dynamicRef) gen.var(N.dynamicAnchors, _`{}`)\n }\n )\n}\n\nfunction topSchemaObjCode(it: SchemaObjCxt): void {\n const {schema, opts, gen} = it\n validateFunction(it, () => {\n if (opts.$comment && schema.$comment) commentKeyword(it)\n checkNoDefault(it)\n gen.let(N.vErrors, null)\n gen.let(N.errors, 0)\n if (opts.unevaluated) resetEvaluated(it)\n typeAndKeywords(it)\n returnResults(it)\n })\n return\n}\n\nfunction resetEvaluated(it: SchemaObjCxt): void {\n // TODO maybe some hook to execute it in the end to check whether props/items are Name, as in assignEvaluated\n const {gen, validateName} = it\n it.evaluated = gen.const(\"evaluated\", _`${validateName}.evaluated`)\n gen.if(_`${it.evaluated}.dynamicProps`, () => gen.assign(_`${it.evaluated}.props`, _`undefined`))\n gen.if(_`${it.evaluated}.dynamicItems`, () => gen.assign(_`${it.evaluated}.items`, _`undefined`))\n}\n\nfunction funcSourceUrl(schema: AnySchema, opts: InstanceOptions): Code {\n const schId = typeof schema == \"object\" && schema[opts.schemaId]\n return schId && (opts.code.source || opts.code.process) ? _`/*# sourceURL=${schId} */` : nil\n}\n\n// schema compilation - this function is used recursively to generate code for sub-schemas\nfunction subschemaCode(it: SchemaCxt, valid: Name): void {\n if (isSchemaObj(it)) {\n checkKeywords(it)\n if (schemaCxtHasRules(it)) {\n subSchemaObjCode(it, valid)\n return\n }\n }\n boolOrEmptySchema(it, valid)\n}\n\nfunction schemaCxtHasRules({schema, self}: SchemaCxt): boolean {\n if (typeof schema == \"boolean\") return !schema\n for (const key in schema) if (self.RULES.all[key]) return true\n return false\n}\n\nfunction isSchemaObj(it: SchemaCxt): it is SchemaObjCxt {\n return typeof it.schema != \"boolean\"\n}\n\nfunction subSchemaObjCode(it: SchemaObjCxt, valid: Name): void {\n const {schema, gen, opts} = it\n if (opts.$comment && schema.$comment) commentKeyword(it)\n updateContext(it)\n checkAsyncSchema(it)\n const errsCount = gen.const(\"_errs\", N.errors)\n typeAndKeywords(it, errsCount)\n // TODO var\n gen.var(valid, _`${errsCount} === ${N.errors}`)\n}\n\nfunction checkKeywords(it: SchemaObjCxt): void {\n checkUnknownRules(it)\n checkRefsAndKeywords(it)\n}\n\nfunction typeAndKeywords(it: SchemaObjCxt, errsCount?: Name): void {\n if (it.opts.jtd) return schemaKeywords(it, [], false, errsCount)\n const types = getSchemaTypes(it.schema)\n const checkedTypes = coerceAndCheckDataType(it, types)\n schemaKeywords(it, types, !checkedTypes, errsCount)\n}\n\nfunction checkRefsAndKeywords(it: SchemaObjCxt): void {\n const {schema, errSchemaPath, opts, self} = it\n if (schema.$ref && opts.ignoreKeywordsWithRef && schemaHasRulesButRef(schema, self.RULES)) {\n self.logger.warn(`$ref: keywords ignored in schema at path \"${errSchemaPath}\"`)\n }\n}\n\nfunction checkNoDefault(it: SchemaObjCxt): void {\n const {schema, opts} = it\n if (schema.default !== undefined && opts.useDefaults && opts.strictSchema) {\n checkStrictMode(it, \"default is ignored in the schema root\")\n }\n}\n\nfunction updateContext(it: SchemaObjCxt): void {\n const schId = it.schema[it.opts.schemaId]\n if (schId) it.baseId = resolveUrl(it.opts.uriResolver, it.baseId, schId)\n}\n\nfunction checkAsyncSchema(it: SchemaObjCxt): void {\n if (it.schema.$async && !it.schemaEnv.$async) throw new Error(\"async schema in sync schema\")\n}\n\nfunction commentKeyword({gen, schemaEnv, schema, errSchemaPath, opts}: SchemaObjCxt): void {\n const msg = schema.$comment\n if (opts.$comment === true) {\n gen.code(_`${N.self}.logger.log(${msg})`)\n } else if (typeof opts.$comment == \"function\") {\n const schemaPath = str`${errSchemaPath}/$comment`\n const rootName = gen.scopeValue(\"root\", {ref: schemaEnv.root})\n gen.code(_`${N.self}.opts.$comment(${msg}, ${schemaPath}, ${rootName}.schema)`)\n }\n}\n\nfunction returnResults(it: SchemaCxt): void {\n const {gen, schemaEnv, validateName, ValidationError, opts} = it\n if (schemaEnv.$async) {\n // TODO assign unevaluated\n gen.if(\n _`${N.errors} === 0`,\n () => gen.return(N.data),\n () => gen.throw(_`new ${ValidationError as Name}(${N.vErrors})`)\n )\n } else {\n gen.assign(_`${validateName}.errors`, N.vErrors)\n if (opts.unevaluated) assignEvaluated(it)\n gen.return(_`${N.errors} === 0`)\n }\n}\n\nfunction assignEvaluated({gen, evaluated, props, items}: SchemaCxt): void {\n if (props instanceof Name) gen.assign(_`${evaluated}.props`, props)\n if (items instanceof Name) gen.assign(_`${evaluated}.items`, items)\n}\n\nfunction schemaKeywords(\n it: SchemaObjCxt,\n types: JSONType[],\n typeErrors: boolean,\n errsCount?: Name\n): void {\n const {gen, schema, data, allErrors, opts, self} = it\n const {RULES} = self\n if (schema.$ref && (opts.ignoreKeywordsWithRef || !schemaHasRulesButRef(schema, RULES))) {\n gen.block(() => keywordCode(it, \"$ref\", (RULES.all.$ref as Rule).definition)) // TODO typecast\n return\n }\n if (!opts.jtd) checkStrictTypes(it, types)\n gen.block(() => {\n for (const group of RULES.rules) groupKeywords(group)\n groupKeywords(RULES.post)\n })\n\n function groupKeywords(group: RuleGroup): void {\n if (!shouldUseGroup(schema, group)) return\n if (group.type) {\n gen.if(checkDataType(group.type, data, opts.strictNumbers))\n iterateKeywords(it, group)\n if (types.length === 1 && types[0] === group.type && typeErrors) {\n gen.else()\n reportTypeError(it)\n }\n gen.endIf()\n } else {\n iterateKeywords(it, group)\n }\n // TODO make it \"ok\" call?\n if (!allErrors) gen.if(_`${N.errors} === ${errsCount || 0}`)\n }\n}\n\nfunction iterateKeywords(it: SchemaObjCxt, group: RuleGroup): void {\n const {\n gen,\n schema,\n opts: {useDefaults},\n } = it\n if (useDefaults) assignDefaults(it, group.type)\n gen.block(() => {\n for (const rule of group.rules) {\n if (shouldUseRule(schema, rule)) {\n keywordCode(it, rule.keyword, rule.definition, group.type)\n }\n }\n })\n}\n\nfunction checkStrictTypes(it: SchemaObjCxt, types: JSONType[]): void {\n if (it.schemaEnv.meta || !it.opts.strictTypes) return\n checkContextTypes(it, types)\n if (!it.opts.allowUnionTypes) checkMultipleTypes(it, types)\n checkKeywordTypes(it, it.dataTypes)\n}\n\nfunction checkContextTypes(it: SchemaObjCxt, types: JSONType[]): void {\n if (!types.length) return\n if (!it.dataTypes.length) {\n it.dataTypes = types\n return\n }\n types.forEach((t) => {\n if (!includesType(it.dataTypes, t)) {\n strictTypesError(it, `type \"${t}\" not allowed by context \"${it.dataTypes.join(\",\")}\"`)\n }\n })\n narrowSchemaTypes(it, types)\n}\n\nfunction checkMultipleTypes(it: SchemaObjCxt, ts: JSONType[]): void {\n if (ts.length > 1 && !(ts.length === 2 && ts.includes(\"null\"))) {\n strictTypesError(it, \"use allowUnionTypes to allow union type keyword\")\n }\n}\n\nfunction checkKeywordTypes(it: SchemaObjCxt, ts: JSONType[]): void {\n const rules = it.self.RULES.all\n for (const keyword in rules) {\n const rule = rules[keyword]\n if (typeof rule == \"object\" && shouldUseRule(it.schema, rule)) {\n const {type} = rule.definition\n if (type.length && !type.some((t) => hasApplicableType(ts, t))) {\n strictTypesError(it, `missing type \"${type.join(\",\")}\" for keyword \"${keyword}\"`)\n }\n }\n }\n}\n\nfunction hasApplicableType(schTs: JSONType[], kwdT: JSONType): boolean {\n return schTs.includes(kwdT) || (kwdT === \"number\" && schTs.includes(\"integer\"))\n}\n\nfunction includesType(ts: JSONType[], t: JSONType): boolean {\n return ts.includes(t) || (t === \"integer\" && ts.includes(\"number\"))\n}\n\nfunction narrowSchemaTypes(it: SchemaObjCxt, withTypes: JSONType[]): void {\n const ts: JSONType[] = []\n for (const t of it.dataTypes) {\n if (includesType(withTypes, t)) ts.push(t)\n else if (withTypes.includes(\"integer\") && t === \"number\") ts.push(\"integer\")\n }\n it.dataTypes = ts\n}\n\nfunction strictTypesError(it: SchemaObjCxt, msg: string): void {\n const schemaPath = it.schemaEnv.baseId + it.errSchemaPath\n msg += ` at \"${schemaPath}\" (strictTypes)`\n checkStrictMode(it, msg, it.opts.strictTypes)\n}\n\nexport class KeywordCxt implements KeywordErrorCxt {\n readonly gen: CodeGen\n readonly allErrors?: boolean\n readonly keyword: string\n readonly data: Name // Name referencing the current level of the data instance\n readonly $data?: string | false\n schema: any // keyword value in the schema\n readonly schemaValue: Code | number | boolean // Code reference to keyword schema value or primitive value\n readonly schemaCode: Code | number | boolean // Code reference to resolved schema value (different if schema is $data)\n readonly schemaType: JSONType[] // allowed type(s) of keyword value in the schema\n readonly parentSchema: AnySchemaObject\n readonly errsCount?: Name // Name reference to the number of validation errors collected before this keyword,\n // requires option trackErrors in keyword definition\n params: KeywordCxtParams // object to pass parameters to error messages from keyword code\n readonly it: SchemaObjCxt // schema compilation context (schema is guaranteed to be an object, not boolean)\n readonly def: AddedKeywordDefinition\n\n constructor(it: SchemaObjCxt, def: AddedKeywordDefinition, keyword: string) {\n validateKeywordUsage(it, def, keyword)\n this.gen = it.gen\n this.allErrors = it.allErrors\n this.keyword = keyword\n this.data = it.data\n this.schema = it.schema[keyword]\n this.$data = def.$data && it.opts.$data && this.schema && this.schema.$data\n this.schemaValue = schemaRefOrVal(it, this.schema, keyword, this.$data)\n this.schemaType = def.schemaType\n this.parentSchema = it.schema\n this.params = {}\n this.it = it\n this.def = def\n\n if (this.$data) {\n this.schemaCode = it.gen.const(\"vSchema\", getData(this.$data, it))\n } else {\n this.schemaCode = this.schemaValue\n if (!validSchemaType(this.schema, def.schemaType, def.allowUndefined)) {\n throw new Error(`${keyword} value must be ${JSON.stringify(def.schemaType)}`)\n }\n }\n\n if (\"code\" in def ? def.trackErrors : def.errors !== false) {\n this.errsCount = it.gen.const(\"_errs\", N.errors)\n }\n }\n\n result(condition: Code, successAction?: () => void, failAction?: () => void): void {\n this.failResult(not(condition), successAction, failAction)\n }\n\n failResult(condition: Code, successAction?: () => void, failAction?: () => void): void {\n this.gen.if(condition)\n if (failAction) failAction()\n else this.error()\n if (successAction) {\n this.gen.else()\n successAction()\n if (this.allErrors) this.gen.endIf()\n } else {\n if (this.allErrors) this.gen.endIf()\n else this.gen.else()\n }\n }\n\n pass(condition: Code, failAction?: () => void): void {\n this.failResult(not(condition), undefined, failAction)\n }\n\n fail(condition?: Code): void {\n if (condition === undefined) {\n this.error()\n if (!this.allErrors) this.gen.if(false) // this branch will be removed by gen.optimize\n return\n }\n this.gen.if(condition)\n this.error()\n if (this.allErrors) this.gen.endIf()\n else this.gen.else()\n }\n\n fail$data(condition: Code): void {\n if (!this.$data) return this.fail(condition)\n const {schemaCode} = this\n this.fail(_`${schemaCode} !== undefined && (${or(this.invalid$data(), condition)})`)\n }\n\n error(append?: boolean, errorParams?: KeywordCxtParams, errorPaths?: ErrorPaths): void {\n if (errorParams) {\n this.setParams(errorParams)\n this._error(append, errorPaths)\n this.setParams({})\n return\n }\n this._error(append, errorPaths)\n }\n\n private _error(append?: boolean, errorPaths?: ErrorPaths): void {\n ;(append ? reportExtraError : reportError)(this, this.def.error, errorPaths)\n }\n\n $dataError(): void {\n reportError(this, this.def.$dataError || keyword$DataError)\n }\n\n reset(): void {\n if (this.errsCount === undefined) throw new Error('add \"trackErrors\" to keyword definition')\n resetErrorsCount(this.gen, this.errsCount)\n }\n\n ok(cond: Code | boolean): void {\n if (!this.allErrors) this.gen.if(cond)\n }\n\n setParams(obj: KeywordCxtParams, assign?: true): void {\n if (assign) Object.assign(this.params, obj)\n else this.params = obj\n }\n\n block$data(valid: Name, codeBlock: () => void, $dataValid: Code = nil): void {\n this.gen.block(() => {\n this.check$data(valid, $dataValid)\n codeBlock()\n })\n }\n\n check$data(valid: Name = nil, $dataValid: Code = nil): void {\n if (!this.$data) return\n const {gen, schemaCode, schemaType, def} = this\n gen.if(or(_`${schemaCode} === undefined`, $dataValid))\n if (valid !== nil) gen.assign(valid, true)\n if (schemaType.length || def.validateSchema) {\n gen.elseIf(this.invalid$data())\n this.$dataError()\n if (valid !== nil) gen.assign(valid, false)\n }\n gen.else()\n }\n\n invalid$data(): Code {\n const {gen, schemaCode, schemaType, def, it} = this\n return or(wrong$DataType(), invalid$DataSchema())\n\n function wrong$DataType(): Code {\n if (schemaType.length) {\n /* istanbul ignore if */\n if (!(schemaCode instanceof Name)) throw new Error(\"ajv implementation error\")\n const st = Array.isArray(schemaType) ? schemaType : [schemaType]\n return _`${checkDataTypes(st, schemaCode, it.opts.strictNumbers, DataType.Wrong)}`\n }\n return nil\n }\n\n function invalid$DataSchema(): Code {\n if (def.validateSchema) {\n const validateSchemaRef = gen.scopeValue(\"validate$data\", {ref: def.validateSchema}) // TODO value.code for standalone\n return _`!${validateSchemaRef}(${schemaCode})`\n }\n return nil\n }\n }\n\n subschema(appl: SubschemaArgs, valid: Name): SchemaCxt {\n const subschema = getSubschema(this.it, appl)\n extendSubschemaData(subschema, this.it, appl)\n extendSubschemaMode(subschema, appl)\n const nextContext = {...this.it, ...subschema, items: undefined, props: undefined}\n subschemaCode(nextContext, valid)\n return nextContext\n }\n\n mergeEvaluated(schemaCxt: SchemaCxt, toName?: typeof Name): void {\n const {it, gen} = this\n if (!it.opts.unevaluated) return\n if (it.props !== true && schemaCxt.props !== undefined) {\n it.props = mergeEvaluated.props(gen, schemaCxt.props, it.props, toName)\n }\n if (it.items !== true && schemaCxt.items !== undefined) {\n it.items = mergeEvaluated.items(gen, schemaCxt.items, it.items, toName)\n }\n }\n\n mergeValidEvaluated(schemaCxt: SchemaCxt, valid: Name): boolean | void {\n const {it, gen} = this\n if (it.opts.unevaluated && (it.props !== true || it.items !== true)) {\n gen.if(valid, () => this.mergeEvaluated(schemaCxt, Name))\n return true\n }\n }\n}\n\nfunction keywordCode(\n it: SchemaObjCxt,\n keyword: string,\n def: AddedKeywordDefinition,\n ruleType?: JSONType\n): void {\n const cxt = new KeywordCxt(it, def, keyword)\n if (\"code\" in def) {\n def.code(cxt, ruleType)\n } else if (cxt.$data && def.validate) {\n funcKeywordCode(cxt, def)\n } else if (\"macro\" in def) {\n macroKeywordCode(cxt, def)\n } else if (def.compile || def.validate) {\n funcKeywordCode(cxt, def)\n }\n}\n\nconst JSON_POINTER = /^\\/(?:[^~]|~0|~1)*$/\nconst RELATIVE_JSON_POINTER = /^([0-9]+)(#|\\/(?:[^~]|~0|~1)*)?$/\nexport function getData(\n $data: string,\n {dataLevel, dataNames, dataPathArr}: SchemaCxt\n): Code | number {\n let jsonPointer\n let data: Code\n if ($data === \"\") return N.rootData\n if ($data[0] === \"/\") {\n if (!JSON_POINTER.test($data)) throw new Error(`Invalid JSON-pointer: ${$data}`)\n jsonPointer = $data\n data = N.rootData\n } else {\n const matches = RELATIVE_JSON_POINTER.exec($data)\n if (!matches) throw new Error(`Invalid JSON-pointer: ${$data}`)\n const up: number = +matches[1]\n jsonPointer = matches[2]\n if (jsonPointer === \"#\") {\n if (up >= dataLevel) throw new Error(errorMsg(\"property/index\", up))\n return dataPathArr[dataLevel - up]\n }\n if (up > dataLevel) throw new Error(errorMsg(\"data\", up))\n data = dataNames[dataLevel - up]\n if (!jsonPointer) return data\n }\n\n let expr = data\n const segments = jsonPointer.split(\"/\")\n for (const segment of segments) {\n if (segment) {\n data = _`${data}${getProperty(unescapeJsonPointer(segment))}`\n expr = _`${expr} && ${data}`\n }\n }\n return expr\n\n function errorMsg(pointerType: string, up: number): string {\n return `Cannot access ${pointerType} ${up} levels up, current level is ${dataLevel}`\n }\n}\n", "import type {ErrorObject} from \"../types\"\n\nexport default class ValidationError extends Error {\n readonly errors: Partial<ErrorObject>[]\n readonly ajv: true\n readonly validation: true\n\n constructor(errors: Partial<ErrorObject>[]) {\n super(\"validation failed\")\n this.errors = errors\n this.ajv = this.validation = true\n }\n}\n", "import {resolveUrl, normalizeId, getFullPath} from \"./resolve\"\nimport type {UriResolver} from \"../types\"\n\nexport default class MissingRefError extends Error {\n readonly missingRef: string\n readonly missingSchema: string\n\n constructor(resolver: UriResolver, baseId: string, ref: string, msg?: string) {\n super(msg || `can't resolve reference ${ref} from id ${baseId}`)\n this.missingRef = resolveUrl(resolver, baseId, ref)\n this.missingSchema = normalizeId(getFullPath(resolver, this.missingRef))\n }\n}\n", "import type {\n AnySchema,\n AnySchemaObject,\n AnyValidateFunction,\n AsyncValidateFunction,\n EvaluatedProperties,\n EvaluatedItems,\n} from \"../types\"\nimport type Ajv from \"../core\"\nimport type {InstanceOptions} from \"../core\"\nimport {CodeGen, _, nil, stringify, Name, Code, ValueScopeName} from \"./codegen\"\nimport ValidationError from \"../runtime/validation_error\"\nimport N from \"./names\"\nimport {LocalRefs, getFullPath, _getFullPath, inlineRef, normalizeId, resolveUrl} from \"./resolve\"\nimport {schemaHasRulesButRef, unescapeFragment} from \"./util\"\nimport {validateFunctionCode} from \"./validate\"\nimport {URIComponent} from \"fast-uri\"\nimport {JSONType} from \"./rules\"\n\nexport type SchemaRefs = {\n [Ref in string]?: SchemaEnv | AnySchema\n}\n\nexport interface SchemaCxt {\n readonly gen: CodeGen\n readonly allErrors?: boolean // validation mode - whether to collect all errors or break on error\n readonly data: Name // Name with reference to the current part of data instance\n readonly parentData: Name // should be used in keywords modifying data\n readonly parentDataProperty: Code | number // should be used in keywords modifying data\n readonly dataNames: Name[]\n readonly dataPathArr: (Code | number)[]\n readonly dataLevel: number // the level of the currently validated data,\n // it can be used to access both the property names and the data on all levels from the top.\n dataTypes: JSONType[] // data types applied to the current part of data instance\n definedProperties: Set<string> // set of properties to keep track of for required checks\n readonly topSchemaRef: Code\n readonly validateName: Name\n evaluated?: Name\n readonly ValidationError?: Name\n readonly schema: AnySchema // current schema object - equal to parentSchema passed via KeywordCxt\n readonly schemaEnv: SchemaEnv\n readonly rootId: string\n baseId: string // the current schema base URI that should be used as the base for resolving URIs in references (\\$ref)\n readonly schemaPath: Code // the run-time expression that evaluates to the property name of the current schema\n readonly errSchemaPath: string // this is actual string, should not be changed to Code\n readonly errorPath: Code\n readonly propertyName?: Name\n readonly compositeRule?: boolean // true indicates that the current schema is inside the compound keyword,\n // where failing some rule doesn't mean validation failure (`anyOf`, `oneOf`, `not`, `if`).\n // This flag is used to determine whether you can return validation result immediately after any error in case the option `allErrors` is not `true.\n // You only need to use it if you have many steps in your keywords and potentially can define multiple errors.\n props?: EvaluatedProperties | Name // properties evaluated by this schema - used by parent schema or assigned to validation function\n items?: EvaluatedItems | Name // last item evaluated by this schema - used by parent schema or assigned to validation function\n jtdDiscriminator?: string\n jtdMetadata?: boolean\n readonly createErrors?: boolean\n readonly opts: InstanceOptions // Ajv instance option.\n readonly self: Ajv // current Ajv instance\n}\n\nexport interface SchemaObjCxt extends SchemaCxt {\n readonly schema: AnySchemaObject\n}\ninterface SchemaEnvArgs {\n readonly schema: AnySchema\n readonly schemaId?: \"$id\" | \"id\"\n readonly root?: SchemaEnv\n readonly baseId?: string\n readonly schemaPath?: string\n readonly localRefs?: LocalRefs\n readonly meta?: boolean\n}\n\nexport class SchemaEnv implements SchemaEnvArgs {\n readonly schema: AnySchema\n readonly schemaId?: \"$id\" | \"id\"\n readonly root: SchemaEnv\n baseId: string // TODO possibly, it should be readonly\n schemaPath?: string\n localRefs?: LocalRefs\n readonly meta?: boolean\n readonly $async?: boolean // true if the current schema is asynchronous.\n readonly refs: SchemaRefs = {}\n readonly dynamicAnchors: {[Ref in string]?: true} = {}\n validate?: AnyValidateFunction\n validateName?: ValueScopeName\n serialize?: (data: unknown) => string\n serializeName?: ValueScopeName\n parse?: (data: string) => unknown\n parseName?: ValueScopeName\n\n constructor(env: SchemaEnvArgs) {\n let schema: AnySchemaObject | undefined\n if (typeof env.schema == \"object\") schema = env.schema\n this.schema = env.schema\n this.schemaId = env.schemaId\n this.root = env.root || this\n this.baseId = env.baseId ?? normalizeId(schema?.[env.schemaId || \"$id\"])\n this.schemaPath = env.schemaPath\n this.localRefs = env.localRefs\n this.meta = env.meta\n this.$async = schema?.$async\n this.refs = {}\n }\n}\n\n// let codeSize = 0\n// let nodeCount = 0\n\n// Compiles schema in SchemaEnv\nexport function compileSchema(this: Ajv, sch: SchemaEnv): SchemaEnv {\n // TODO refactor - remove compilations\n const _sch = getCompilingSchema.call(this, sch)\n if (_sch) return _sch\n const rootId = getFullPath(this.opts.uriResolver, sch.root.baseId) // TODO if getFullPath removed 1 tests fails\n const {es5, lines} = this.opts.code\n const {ownProperties} = this.opts\n const gen = new CodeGen(this.scope, {es5, lines, ownProperties})\n let _ValidationError\n if (sch.$async) {\n _ValidationError = gen.scopeValue(\"Error\", {\n ref: ValidationError,\n code: _`require(\"ajv/dist/runtime/validation_error\").default`,\n })\n }\n\n const validateName = gen.scopeName(\"validate\")\n sch.validateName = validateName\n\n const schemaCxt: SchemaCxt = {\n gen,\n allErrors: this.opts.allErrors,\n data: N.data,\n parentData: N.parentData,\n parentDataProperty: N.parentDataProperty,\n dataNames: [N.data],\n dataPathArr: [nil], // TODO can its length be used as dataLevel if nil is removed?\n dataLevel: 0,\n dataTypes: [],\n definedProperties: new Set<string>(),\n topSchemaRef: gen.scopeValue(\n \"schema\",\n this.opts.code.source === true\n ? {ref: sch.schema, code: stringify(sch.schema)}\n : {ref: sch.schema}\n ),\n validateName,\n ValidationError: _ValidationError,\n schema: sch.schema,\n schemaEnv: sch,\n rootId,\n baseId: sch.baseId || rootId,\n schemaPath: nil,\n errSchemaPath: sch.schemaPath || (this.opts.jtd ? \"\" : \"#\"),\n errorPath: _`\"\"`,\n opts: this.opts,\n self: this,\n }\n\n let sourceCode: string | undefined\n try {\n this._compilations.add(sch)\n validateFunctionCode(schemaCxt)\n gen.optimize(this.opts.code.optimize)\n // gen.optimize(1)\n const validateCode = gen.toString()\n sourceCode = `${gen.scopeRefs(N.scope)}return ${validateCode}`\n // console.log((codeSize += sourceCode.length), (nodeCount += gen.nodeCount))\n if (this.opts.code.process) sourceCode = this.opts.code.process(sourceCode, sch)\n // console.log(\"\\n\\n\\n *** \\n\", sourceCode)\n const makeValidate = new Function(`${N.self}`, `${N.scope}`, sourceCode)\n const validate: AnyValidateFunction = makeValidate(this, this.scope.get())\n this.scope.value(validateName, {ref: validate})\n\n validate.errors = null\n validate.schema = sch.schema\n validate.schemaEnv = sch\n if (sch.$async) (validate as AsyncValidateFunction).$async = true\n if (this.opts.code.source === true) {\n validate.source = {validateName, validateCode, scopeValues: gen._values}\n }\n if (this.opts.unevaluated) {\n const {props, items} = schemaCxt\n validate.evaluated = {\n props: props instanceof Name ? undefined : props,\n items: items instanceof Name ? undefined : items,\n dynamicProps: props instanceof Name,\n dynamicItems: items instanceof Name,\n }\n if (validate.source) validate.source.evaluated = stringify(validate.evaluated)\n }\n sch.validate = validate\n return sch\n } catch (e) {\n delete sch.validate\n delete sch.validateName\n if (sourceCode) this.logger.error(\"Error compiling schema, function code:\", sourceCode)\n // console.log(\"\\n\\n\\n *** \\n\", sourceCode, this.opts)\n throw e\n } finally {\n this._compilations.delete(sch)\n }\n}\n\nexport function resolveRef(\n this: Ajv,\n root: SchemaEnv,\n baseId: string,\n ref: string\n): AnySchema | SchemaEnv | undefined {\n ref = resolveUrl(this.opts.uriResolver, baseId, ref)\n const schOrFunc = root.refs[ref]\n if (schOrFunc) return schOrFunc\n\n let _sch = resolve.call(this, root, ref)\n if (_sch === undefined) {\n const schema = root.localRefs?.[ref] // TODO maybe localRefs should hold SchemaEnv\n const {schemaId} = this.opts\n if (schema) _sch = new SchemaEnv({schema, schemaId, root, baseId})\n }\n\n if (_sch === undefined) return\n return (root.refs[ref] = inlineOrCompile.call(this, _sch))\n}\n\nfunction inlineOrCompile(this: Ajv, sch: SchemaEnv): AnySchema | SchemaEnv {\n if (inlineRef(sch.schema, this.opts.inlineRefs)) return sch.schema\n return sch.validate ? sch : compileSchema.call(this, sch)\n}\n\n// Index of schema compilation in the currently compiled list\nexport function getCompilingSchema(this: Ajv, schEnv: SchemaEnv): SchemaEnv | void {\n for (const sch of this._compilations) {\n if (sameSchemaEnv(sch, schEnv)) return sch\n }\n}\n\nfunction sameSchemaEnv(s1: SchemaEnv, s2: SchemaEnv): boolean {\n return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId\n}\n\n// resolve and compile the references ($ref)\n// TODO returns AnySchemaObject (if the schema can be inlined) or validation function\nfunction resolve(\n this: Ajv,\n root: SchemaEnv, // information about the root schema for the current schema\n ref: string // reference to resolve\n): SchemaEnv | undefined {\n let sch\n while (typeof (sch = this.refs[ref]) == \"string\") ref = sch\n return sch || this.schemas[ref] || resolveSchema.call(this, root, ref)\n}\n\n// Resolve schema, its root and baseId\nexport function resolveSchema(\n this: Ajv,\n root: SchemaEnv, // root object with properties schema, refs TODO below SchemaEnv is assigned to it\n ref: string // reference to resolve\n): SchemaEnv | undefined {\n const p = this.opts.uriResolver.parse(ref)\n const refPath = _getFullPath(this.opts.uriResolver, p)\n let baseId = getFullPath(this.opts.uriResolver, root.baseId, undefined)\n // TODO `Object.keys(root.schema).length > 0` should not be needed - but removing breaks 2 tests\n if (Object.keys(root.schema).length > 0 && refPath === baseId) {\n return getJsonPointer.call(this, p, root)\n }\n\n const id = normalizeId(refPath)\n const schOrRef = this.refs[id] || this.schemas[id]\n if (typeof schOrRef == \"string\") {\n const sch = resolveSchema.call(this, root, schOrRef)\n if (typeof sch?.schema !== \"object\") return\n return getJsonPointer.call(this, p, sch)\n }\n\n if (typeof schOrRef?.schema !== \"object\") return\n if (!schOrRef.validate) compileSchema.call(this, schOrRef)\n if (id === normalizeId(ref)) {\n const {schema} = schOrRef\n const {schemaId} = this.opts\n const schId = schema[schemaId]\n if (schId) baseId = resolveUrl(this.opts.uriResolver, baseId, schId)\n return new SchemaEnv({schema, schemaId, root, baseId})\n }\n return getJsonPointer.call(this, p, schOrRef)\n}\n\nconst PREVENT_SCOPE_CHANGE = new Set([\n \"properties\",\n \"patternProperties\",\n \"enum\",\n \"dependencies\",\n \"definitions\",\n])\n\nfunction getJsonPointer(\n this: Ajv,\n parsedRef: URIComponent,\n {baseId, schema, root}: SchemaEnv\n): SchemaEnv | undefined {\n if (parsedRef.fragment?.[0] !== \"/\") return\n for (const part of parsedRef.fragment.slice(1).split(\"/\")) {\n if (typeof schema === \"boolean\") return\n const partSchema = schema[unescapeFragment(part)]\n if (partSchema === undefined) return\n schema = partSchema\n // TODO PREVENT_SCOPE_CHANGE could be defined in keyword def?\n const schId = typeof schema === \"object\" && schema[this.opts.schemaId]\n if (!PREVENT_SCOPE_CHANGE.has(part) && schId) {\n baseId = resolveUrl(this.opts.uriResolver, baseId, schId)\n }\n }\n let env: SchemaEnv | undefined\n if (typeof schema != \"boolean\" && schema.$ref && !schemaHasRulesButRef(schema, this.RULES)) {\n const $ref = resolveUrl(this.opts.uriResolver, baseId, schema.$ref)\n env = resolveSchema.call(this, root, $ref)\n }\n // even though resolution failed we need to return SchemaEnv to throw exception\n // so that compileAsync loads missing schema.\n const {schemaId} = this.opts\n env = env || new SchemaEnv({schema, schemaId, root, baseId})\n if (env.schema !== env.root.schema) return env\n return undefined\n}\n", "{\n \"$id\": \"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#\",\n \"description\": \"Meta-schema for $data reference (JSON AnySchema extension proposal)\",\n \"type\": \"object\",\n \"required\": [\"$data\"],\n \"properties\": {\n \"$data\": {\n \"type\": \"string\",\n \"anyOf\": [{\"format\": \"relative-json-pointer\"}, {\"format\": \"json-pointer\"}]\n }\n },\n \"additionalProperties\": false\n}\n", "'use strict'\n\n/** @type {(value: string) => boolean} */\nconst isUUID = RegExp.prototype.test.bind(/^[\\da-f]{8}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{12}$/iu)\n\n/** @type {(value: string) => boolean} */\nconst isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)$/u)\n\n/** @type {(value: string) => boolean} */\nconst isHexPair = RegExp.prototype.test.bind(/^[\\da-f]{2}$/iu)\n\n/** @type {(value: string) => boolean} */\nconst isUnreserved = RegExp.prototype.test.bind(/^[\\da-z\\-._~]$/iu)\n\n/** @type {(value: string) => boolean} */\nconst isPathCharacter = RegExp.prototype.test.bind(/^[\\da-z\\-._~!$&'()*+,;=:@/]$/iu)\n\n/**\n * @param {Array<string>} input\n * @returns {string}\n */\nfunction stringArrayToHexStripped (input) {\n let acc = ''\n let code = 0\n let i = 0\n\n for (i = 0; i < input.length; i++) {\n code = input[i].charCodeAt(0)\n if (code === 48) {\n continue\n }\n if (!((code >= 48 && code <= 57) || (code >= 65 && code <= 70) || (code >= 97 && code <= 102))) {\n return ''\n }\n acc += input[i]\n break\n }\n\n for (i += 1; i < input.length; i++) {\n code = input[i].charCodeAt(0)\n if (!((code >= 48 && code <= 57) || (code >= 65 && code <= 70) || (code >= 97 && code <= 102))) {\n return ''\n }\n acc += input[i]\n }\n return acc\n}\n\n/**\n * @typedef {Object} GetIPV6Result\n * @property {boolean} error - Indicates if there was an error parsing the IPv6 address.\n * @property {string} address - The parsed IPv6 address.\n * @property {string} [zone] - The zone identifier, if present.\n */\n\n/**\n * @param {string} value\n * @returns {boolean}\n */\nconst nonSimpleDomain = RegExp.prototype.test.bind(/[^!\"$&'()*+,\\-.;=_`a-z{}~]/u)\n\n/**\n * @param {Array<string>} buffer\n * @returns {boolean}\n */\nfunction consumeIsZone (buffer) {\n buffer.length = 0\n return true\n}\n\n/**\n * @param {Array<string>} buffer\n * @param {Array<string>} address\n * @param {GetIPV6Result} output\n * @returns {boolean}\n */\nfunction consumeHextets (buffer, address, output) {\n if (buffer.length) {\n const hex = stringArrayToHexStripped(buffer)\n if (hex !== '') {\n address.push(hex)\n } else {\n output.error = true\n return false\n }\n buffer.length = 0\n }\n return true\n}\n\n/**\n * @param {string} input\n * @returns {GetIPV6Result}\n */\nfunction getIPV6 (input) {\n let tokenCount = 0\n const output = { error: false, address: '', zone: '' }\n /** @type {Array<string>} */\n const address = []\n /** @type {Array<string>} */\n const buffer = []\n let endipv6Encountered = false\n let endIpv6 = false\n\n let consume = consumeHextets\n\n for (let i = 0; i < input.length; i++) {\n const cursor = input[i]\n if (cursor === '[' || cursor === ']') { continue }\n if (cursor === ':') {\n if (endipv6Encountered === true) {\n endIpv6 = true\n }\n if (!consume(buffer, address, output)) { break }\n if (++tokenCount > 7) {\n // not valid\n output.error = true\n break\n }\n if (i > 0 && input[i - 1] === ':') {\n endipv6Encountered = true\n }\n address.push(':')\n continue\n } else if (cursor === '%') {\n if (!consume(buffer, address, output)) { break }\n // switch to zone detection\n consume = consumeIsZone\n } else {\n buffer.push(cursor)\n continue\n }\n }\n if (buffer.length) {\n if (consume === consumeIsZone) {\n output.zone = buffer.join('')\n } else if (endIpv6) {\n address.push(buffer.join(''))\n } else {\n address.push(stringArrayToHexStripped(buffer))\n }\n }\n output.address = address.join('')\n return output\n}\n\n/**\n * @typedef {Object} NormalizeIPv6Result\n * @property {string} host - The normalized host.\n * @property {string} [escapedHost] - The escaped host.\n * @property {boolean} isIPV6 - Indicates if the host is an IPv6 address.\n */\n\n/**\n * @param {string} host\n * @returns {NormalizeIPv6Result}\n */\nfunction normalizeIPv6 (host) {\n if (findToken(host, ':') < 2) { return { host, isIPV6: false } }\n const ipv6 = getIPV6(host)\n\n if (!ipv6.error) {\n let newHost = ipv6.address\n let escapedHost = ipv6.address\n if (ipv6.zone) {\n newHost += '%' + ipv6.zone\n escapedHost += '%25' + ipv6.zone\n }\n return { host: newHost, isIPV6: true, escapedHost }\n } else {\n return { host, isIPV6: false }\n }\n}\n\n/**\n * @param {string} str\n * @param {string} token\n * @returns {number}\n */\nfunction findToken (str, token) {\n let ind = 0\n for (let i = 0; i < str.length; i++) {\n if (str[i] === token) ind++\n }\n return ind\n}\n\n/**\n * @param {string} path\n * @returns {string}\n *\n * @see https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4\n */\nfunction removeDotSegments (path) {\n let input = path\n const output = []\n let nextSlash = -1\n let len = 0\n\n // eslint-disable-next-line no-cond-assign\n while (len = input.length) {\n if (len === 1) {\n if (input === '.') {\n break\n } else if (input === '/') {\n output.push('/')\n break\n } else {\n output.push(input)\n break\n }\n } else if (len === 2) {\n if (input[0] === '.') {\n if (input[1] === '.') {\n break\n } else if (input[1] === '/') {\n input = input.slice(2)\n continue\n }\n } else if (input[0] === '/') {\n if (input[1] === '.' || input[1] === '/') {\n output.push('/')\n break\n }\n }\n } else if (len === 3) {\n if (input === '/..') {\n if (output.length !== 0) {\n output.pop()\n }\n output.push('/')\n break\n }\n }\n if (input[0] === '.') {\n if (input[1] === '.') {\n if (input[2] === '/') {\n input = input.slice(3)\n continue\n }\n } else if (input[1] === '/') {\n input = input.slice(2)\n continue\n }\n } else if (input[0] === '/') {\n if (input[1] === '.') {\n if (input[2] === '/') {\n input = input.slice(2)\n continue\n } else if (input[2] === '.') {\n if (input[3] === '/') {\n input = input.slice(3)\n if (output.length !== 0) {\n output.pop()\n }\n continue\n }\n }\n }\n }\n\n // Rule 2E: Move normal path segment to output\n if ((nextSlash = input.indexOf('/', 1)) === -1) {\n output.push(input)\n break\n } else {\n output.push(input.slice(0, nextSlash))\n input = input.slice(nextSlash)\n }\n }\n\n return output.join('')\n}\n\n/**\n * Re-escape RFC 3986 gen-delims that must not appear literally in the host.\n * After the URI regex parses, these characters cannot be literal in the host\n * field, so any that appear after decoding came from percent-encoding and\n * must be restored to prevent authority structure changes.\n *\n * @param {string} host\n * @param {boolean} isIP - true for IPv4/IPv6 hosts (skip colon re-escaping)\n * @returns {string}\n */\nconst HOST_DELIMS = { '@': '%40', '/': '%2F', '?': '%3F', '#': '%23', ':': '%3A' }\nconst HOST_DELIM_RE = /[@/?#:]/g\nconst HOST_DELIM_NO_COLON_RE = /[@/?#]/g\n\nfunction reescapeHostDelimiters (host, isIP) {\n const re = isIP ? HOST_DELIM_NO_COLON_RE : HOST_DELIM_RE\n re.lastIndex = 0\n return host.replace(re, (ch) => HOST_DELIMS[ch])\n}\n\n/**\n * Normalizes percent escapes and optionally decodes only unreserved ASCII bytes.\n * Reserved delimiters such as `%2F` and `%2E` stay escaped.\n *\n * @param {string} input\n * @param {boolean} [decodeUnreserved=false]\n * @returns {string}\n */\nfunction normalizePercentEncoding (input, decodeUnreserved = false) {\n if (input.indexOf('%') === -1) {\n return input\n }\n\n let output = ''\n\n for (let i = 0; i < input.length; i++) {\n if (input[i] === '%' && i + 2 < input.length) {\n const hex = input.slice(i + 1, i + 3)\n if (isHexPair(hex)) {\n const normalizedHex = hex.toUpperCase()\n const decoded = String.fromCharCode(parseInt(normalizedHex, 16))\n\n if (decodeUnreserved && isUnreserved(decoded)) {\n output += decoded\n } else {\n output += '%' + normalizedHex\n }\n\n i += 2\n continue\n }\n }\n\n output += input[i]\n }\n\n return output\n}\n\n/**\n * Normalizes path data without turning reserved escapes into live path syntax.\n * Valid escapes are uppercased, raw unsafe characters are escaped, and only\n * unreserved bytes that are not `.` are decoded.\n *\n * @param {string} input\n * @returns {string}\n */\nfunction normalizePathEncoding (input) {\n let output = ''\n\n for (let i = 0; i < input.length; i++) {\n if (input[i] === '%' && i + 2 < input.length) {\n const hex = input.slice(i + 1, i + 3)\n if (isHexPair(hex)) {\n const normalizedHex = hex.toUpperCase()\n const decoded = String.fromCharCode(parseInt(normalizedHex, 16))\n\n if (decoded !== '.' && isUnreserved(decoded)) {\n output += decoded\n } else {\n output += '%' + normalizedHex\n }\n\n i += 2\n continue\n }\n }\n\n if (isPathCharacter(input[i])) {\n output += input[i]\n } else {\n output += escape(input[i])\n }\n }\n\n return output\n}\n\n/**\n * Escapes a component while preserving existing valid percent escapes.\n *\n * @param {string} input\n * @returns {string}\n */\nfunction escapePreservingEscapes (input) {\n let output = ''\n\n for (let i = 0; i < input.length; i++) {\n if (input[i] === '%' && i + 2 < input.length) {\n const hex = input.slice(i + 1, i + 3)\n if (isHexPair(hex)) {\n output += '%' + hex.toUpperCase()\n i += 2\n continue\n }\n }\n\n output += escape(input[i])\n }\n\n return output\n}\n\n/**\n * @param {import('../types/index').URIComponent} component\n * @returns {string|undefined}\n */\nfunction recomposeAuthority (component) {\n const uriTokens = []\n\n if (component.userinfo !== undefined) {\n uriTokens.push(component.userinfo)\n uriTokens.push('@')\n }\n\n if (component.host !== undefined) {\n let host = unescape(component.host)\n if (!isIPv4(host)) {\n const ipV6res = normalizeIPv6(host)\n if (ipV6res.isIPV6 === true) {\n host = `[${ipV6res.escapedHost}]`\n } else {\n host = reescapeHostDelimiters(host, false)\n }\n }\n uriTokens.push(host)\n }\n\n if (typeof component.port === 'number' || typeof component.port === 'string') {\n uriTokens.push(':')\n uriTokens.push(String(component.port))\n }\n\n return uriTokens.length ? uriTokens.join('') : undefined\n};\n\nmodule.exports = {\n nonSimpleDomain,\n recomposeAuthority,\n reescapeHostDelimiters,\n normalizePercentEncoding,\n normalizePathEncoding,\n escapePreservingEscapes,\n removeDotSegments,\n isIPv4,\n isUUID,\n normalizeIPv6,\n stringArrayToHexStripped\n}\n", "'use strict'\n\nconst { isUUID } = require('./utils')\nconst URN_REG = /([\\da-z][\\d\\-a-z]{0,31}):((?:[\\w!$'()*+,\\-.:;=@]|%[\\da-f]{2})+)/iu\n\nconst supportedSchemeNames = /** @type {const} */ (['http', 'https', 'ws',\n 'wss', 'urn', 'urn:uuid'])\n\n/** @typedef {supportedSchemeNames[number]} SchemeName */\n\n/**\n * @param {string} name\n * @returns {name is SchemeName}\n */\nfunction isValidSchemeName (name) {\n return supportedSchemeNames.indexOf(/** @type {*} */ (name)) !== -1\n}\n\n/**\n * @callback SchemeFn\n * @param {import('../types/index').URIComponent} component\n * @param {import('../types/index').Options} options\n * @returns {import('../types/index').URIComponent}\n */\n\n/**\n * @typedef {Object} SchemeHandler\n * @property {SchemeName} scheme - The scheme name.\n * @property {boolean} [domainHost] - Indicates if the scheme supports domain hosts.\n * @property {SchemeFn} parse - Function to parse the URI component for this scheme.\n * @property {SchemeFn} serialize - Function to serialize the URI component for this scheme.\n * @property {boolean} [skipNormalize] - Indicates if normalization should be skipped for this scheme.\n * @property {boolean} [absolutePath] - Indicates if the scheme uses absolute paths.\n * @property {boolean} [unicodeSupport] - Indicates if the scheme supports Unicode.\n */\n\n/**\n * @param {import('../types/index').URIComponent} wsComponent\n * @returns {boolean}\n */\nfunction wsIsSecure (wsComponent) {\n if (wsComponent.secure === true) {\n return true\n } else if (wsComponent.secure === false) {\n return false\n } else if (wsComponent.scheme) {\n return (\n wsComponent.scheme.length === 3 &&\n (wsComponent.scheme[0] === 'w' || wsComponent.scheme[0] === 'W') &&\n (wsComponent.scheme[1] === 's' || wsComponent.scheme[1] === 'S') &&\n (wsComponent.scheme[2] === 's' || wsComponent.scheme[2] === 'S')\n )\n } else {\n return false\n }\n}\n\n/** @type {SchemeFn} */\nfunction httpParse (component) {\n if (!component.host) {\n component.error = component.error || 'HTTP URIs must have a host.'\n }\n\n return component\n}\n\n/** @type {SchemeFn} */\nfunction httpSerialize (component) {\n const secure = String(component.scheme).toLowerCase() === 'https'\n\n // normalize the default port\n if (component.port === (secure ? 443 : 80) || component.port === '') {\n component.port = undefined\n }\n\n // normalize the empty path\n if (!component.path) {\n component.path = '/'\n }\n\n // NOTE: We do not parse query strings for HTTP URIs\n // as WWW Form Url Encoded query strings are part of the HTML4+ spec,\n // and not the HTTP spec.\n\n return component\n}\n\n/** @type {SchemeFn} */\nfunction wsParse (wsComponent) {\n// indicate if the secure flag is set\n wsComponent.secure = wsIsSecure(wsComponent)\n\n // construct resouce name\n wsComponent.resourceName = (wsComponent.path || '/') + (wsComponent.query ? '?' + wsComponent.query : '')\n wsComponent.path = undefined\n wsComponent.query = undefined\n\n return wsComponent\n}\n\n/** @type {SchemeFn} */\nfunction wsSerialize (wsComponent) {\n// normalize the default port\n if (wsComponent.port === (wsIsSecure(wsComponent) ? 443 : 80) || wsComponent.port === '') {\n wsComponent.port = undefined\n }\n\n // ensure scheme matches secure flag\n if (typeof wsComponent.secure === 'boolean') {\n wsComponent.scheme = (wsComponent.secure ? 'wss' : 'ws')\n wsComponent.secure = undefined\n }\n\n // reconstruct path from resource name\n if (wsComponent.resourceName) {\n const [path, query] = wsComponent.resourceName.split('?')\n wsComponent.path = (path && path !== '/' ? path : undefined)\n wsComponent.query = query\n wsComponent.resourceName = undefined\n }\n\n // forbid fragment component\n wsComponent.fragment = undefined\n\n return wsComponent\n}\n\n/** @type {SchemeFn} */\nfunction urnParse (urnComponent, options) {\n if (!urnComponent.path) {\n urnComponent.error = 'URN can not be parsed'\n return urnComponent\n }\n const matches = urnComponent.path.match(URN_REG)\n if (matches) {\n const scheme = options.scheme || urnComponent.scheme || 'urn'\n urnComponent.nid = matches[1].toLowerCase()\n urnComponent.nss = matches[2]\n const urnScheme = `${scheme}:${options.nid || urnComponent.nid}`\n const schemeHandler = getSchemeHandler(urnScheme)\n urnComponent.path = undefined\n\n if (schemeHandler) {\n urnComponent = schemeHandler.parse(urnComponent, options)\n }\n } else {\n urnComponent.error = urnComponent.error || 'URN can not be parsed.'\n }\n\n return urnComponent\n}\n\n/** @type {SchemeFn} */\nfunction urnSerialize (urnComponent, options) {\n if (urnComponent.nid === undefined) {\n throw new Error('URN without nid cannot be serialized')\n }\n const scheme = options.scheme || urnComponent.scheme || 'urn'\n const nid = urnComponent.nid.toLowerCase()\n const urnScheme = `${scheme}:${options.nid || nid}`\n const schemeHandler = getSchemeHandler(urnScheme)\n\n if (schemeHandler) {\n urnComponent = schemeHandler.serialize(urnComponent, options)\n }\n\n const uriComponent = urnComponent\n const nss = urnComponent.nss\n uriComponent.path = `${nid || options.nid}:${nss}`\n\n options.skipEscape = true\n return uriComponent\n}\n\n/** @type {SchemeFn} */\nfunction urnuuidParse (urnComponent, options) {\n const uuidComponent = urnComponent\n uuidComponent.uuid = uuidComponent.nss\n uuidComponent.nss = undefined\n\n if (!options.tolerant && (!uuidComponent.uuid || !isUUID(uuidComponent.uuid))) {\n uuidComponent.error = uuidComponent.error || 'UUID is not valid.'\n }\n\n return uuidComponent\n}\n\n/** @type {SchemeFn} */\nfunction urnuuidSerialize (uuidComponent) {\n const urnComponent = uuidComponent\n // normalize UUID\n urnComponent.nss = (uuidComponent.uuid || '').toLowerCase()\n return urnComponent\n}\n\nconst http = /** @type {SchemeHandler} */ ({\n scheme: 'http',\n domainHost: true,\n parse: httpParse,\n serialize: httpSerialize\n})\n\nconst https = /** @type {SchemeHandler} */ ({\n scheme: 'https',\n domainHost: http.domainHost,\n parse: httpParse,\n serialize: httpSerialize\n})\n\nconst ws = /** @type {SchemeHandler} */ ({\n scheme: 'ws',\n domainHost: true,\n parse: wsParse,\n serialize: wsSerialize\n})\n\nconst wss = /** @type {SchemeHandler} */ ({\n scheme: 'wss',\n domainHost: ws.domainHost,\n parse: ws.parse,\n serialize: ws.serialize\n})\n\nconst urn = /** @type {SchemeHandler} */ ({\n scheme: 'urn',\n parse: urnParse,\n serialize: urnSerialize,\n skipNormalize: true\n})\n\nconst urnuuid = /** @type {SchemeHandler} */ ({\n scheme: 'urn:uuid',\n parse: urnuuidParse,\n serialize: urnuuidSerialize,\n skipNormalize: true\n})\n\nconst SCHEMES = /** @type {Record<SchemeName, SchemeHandler>} */ ({\n http,\n https,\n ws,\n wss,\n urn,\n 'urn:uuid': urnuuid\n})\n\nObject.setPrototypeOf(SCHEMES, null)\n\n/**\n * @param {string|undefined} scheme\n * @returns {SchemeHandler|undefined}\n */\nfunction getSchemeHandler (scheme) {\n return (\n scheme && (\n SCHEMES[/** @type {SchemeName} */ (scheme)] ||\n SCHEMES[/** @type {SchemeName} */(scheme.toLowerCase())])\n ) ||\n undefined\n}\n\nmodule.exports = {\n wsIsSecure,\n SCHEMES,\n isValidSchemeName,\n getSchemeHandler,\n}\n", "'use strict'\n\nconst { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, escapePreservingEscapes, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require('./lib/utils')\nconst { SCHEMES, getSchemeHandler } = require('./lib/schemes')\n\n/**\n * @template {import('./types/index').URIComponent|string} T\n * @param {T} uri\n * @param {import('./types/index').Options} [options]\n * @returns {T}\n */\nfunction normalize (uri, options) {\n if (typeof uri === 'string') {\n uri = /** @type {T} */ (normalizeString(uri, options))\n } else if (typeof uri === 'object') {\n uri = /** @type {T} */ (parse(serialize(uri, options), options))\n }\n return uri\n}\n\n/**\n * @param {string} baseURI\n * @param {string} relativeURI\n * @param {import('./types/index').Options} [options]\n * @returns {string}\n */\nfunction resolve (baseURI, relativeURI, options) {\n const schemelessOptions = options ? Object.assign({ scheme: 'null' }, options) : { scheme: 'null' }\n const resolved = resolveComponent(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true)\n schemelessOptions.skipEscape = true\n return serialize(resolved, schemelessOptions)\n}\n\n/**\n * @param {import ('./types/index').URIComponent} base\n * @param {import ('./types/index').URIComponent} relative\n * @param {import('./types/index').Options} [options]\n * @param {boolean} [skipNormalization=false]\n * @returns {import ('./types/index').URIComponent}\n */\nfunction resolveComponent (base, relative, options, skipNormalization) {\n /** @type {import('./types/index').URIComponent} */\n const target = {}\n if (!skipNormalization) {\n base = parse(serialize(base, options), options) // normalize base component\n relative = parse(serialize(relative, options), options) // normalize relative component\n }\n options = options || {}\n\n if (!options.tolerant && relative.scheme) {\n target.scheme = relative.scheme\n // target.authority = relative.authority;\n target.userinfo = relative.userinfo\n target.host = relative.host\n target.port = relative.port\n target.path = removeDotSegments(relative.path || '')\n target.query = relative.query\n } else {\n if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {\n // target.authority = relative.authority;\n target.userinfo = relative.userinfo\n target.host = relative.host\n target.port = relative.port\n target.path = removeDotSegments(relative.path || '')\n target.query = relative.query\n } else {\n if (!relative.path) {\n target.path = base.path\n if (relative.query !== undefined) {\n target.query = relative.query\n } else {\n target.query = base.query\n }\n } else {\n if (relative.path[0] === '/') {\n target.path = removeDotSegments(relative.path)\n } else {\n if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {\n target.path = '/' + relative.path\n } else if (!base.path) {\n target.path = relative.path\n } else {\n target.path = base.path.slice(0, base.path.lastIndexOf('/') + 1) + relative.path\n }\n target.path = removeDotSegments(target.path)\n }\n target.query = relative.query\n }\n // target.authority = base.authority;\n target.userinfo = base.userinfo\n target.host = base.host\n target.port = base.port\n }\n target.scheme = base.scheme\n }\n\n target.fragment = relative.fragment\n\n return target\n}\n\n/**\n * @param {import ('./types/index').URIComponent|string} uriA\n * @param {import ('./types/index').URIComponent|string} uriB\n * @param {import ('./types/index').Options} options\n * @returns {boolean}\n */\nfunction equal (uriA, uriB, options) {\n const normalizedA = normalizeComparableURI(uriA, options)\n const normalizedB = normalizeComparableURI(uriB, options)\n\n return normalizedA !== undefined && normalizedB !== undefined && normalizedA.toLowerCase() === normalizedB.toLowerCase()\n}\n\n/**\n * @param {Readonly<import('./types/index').URIComponent>} cmpts\n * @param {import('./types/index').Options} [opts]\n * @returns {string}\n */\nfunction serialize (cmpts, opts) {\n const component = {\n host: cmpts.host,\n scheme: cmpts.scheme,\n userinfo: cmpts.userinfo,\n port: cmpts.port,\n path: cmpts.path,\n query: cmpts.query,\n nid: cmpts.nid,\n nss: cmpts.nss,\n uuid: cmpts.uuid,\n fragment: cmpts.fragment,\n reference: cmpts.reference,\n resourceName: cmpts.resourceName,\n secure: cmpts.secure,\n error: ''\n }\n const options = Object.assign({}, opts)\n const uriTokens = []\n\n // find scheme handler\n const schemeHandler = getSchemeHandler(options.scheme || component.scheme)\n\n // perform scheme specific serialization\n if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options)\n\n if (component.path !== undefined) {\n if (!options.skipEscape) {\n component.path = escapePreservingEscapes(component.path)\n\n if (component.scheme !== undefined) {\n component.path = component.path.split('%3A').join(':')\n }\n } else {\n component.path = normalizePercentEncoding(component.path)\n }\n }\n\n if (options.reference !== 'suffix' && component.scheme) {\n uriTokens.push(component.scheme, ':')\n }\n\n const authority = recomposeAuthority(component)\n if (authority !== undefined) {\n if (options.reference !== 'suffix') {\n uriTokens.push('//')\n }\n\n uriTokens.push(authority)\n\n if (component.path && component.path[0] !== '/') {\n uriTokens.push('/')\n }\n }\n if (component.path !== undefined) {\n let s = component.path\n\n if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {\n s = removeDotSegments(s)\n }\n\n if (\n authority === undefined &&\n s[0] === '/' &&\n s[1] === '/'\n ) {\n // don't allow the path to start with \"//\"\n s = '/%2F' + s.slice(2)\n }\n\n uriTokens.push(s)\n }\n\n if (component.query !== undefined) {\n uriTokens.push('?', component.query)\n }\n\n if (component.fragment !== undefined) {\n uriTokens.push('#', component.fragment)\n }\n return uriTokens.join('')\n}\n\nconst URI_PARSE = /^(?:([^#/:?]+):)?(?:\\/\\/((?:([^#/?@]*)@)?(\\[[^#/?\\]]+\\]|[^#/:?]*)(?::(\\d*))?))?([^#?]*)(?:\\?([^#]*))?(?:#((?:.|[\\n\\r])*))?/u\n\n/**\n * @param {import('./types/index').URIComponent} parsed\n * @param {RegExpMatchArray} matches\n * @returns {string|undefined}\n */\nfunction getParseError (parsed, matches) {\n if (matches[2] !== undefined && parsed.path && parsed.path[0] !== '/') {\n return 'URI path must start with \"/\" when authority is present.'\n }\n\n if (typeof parsed.port === 'number' && (parsed.port < 0 || parsed.port > 65535)) {\n return 'URI port is malformed.'\n }\n\n return undefined\n}\n\n/**\n * @param {string} uri\n * @param {import('./types/index').Options} [opts]\n * @returns {{ parsed: import('./types/index').URIComponent, malformedAuthorityOrPort: boolean }}\n */\nfunction parseWithStatus (uri, opts) {\n const options = Object.assign({}, opts)\n /** @type {import('./types/index').URIComponent} */\n const parsed = {\n scheme: undefined,\n userinfo: undefined,\n host: '',\n port: undefined,\n path: '',\n query: undefined,\n fragment: undefined\n }\n\n let malformedAuthorityOrPort = false\n\n let isIP = false\n if (options.reference === 'suffix') {\n if (options.scheme) {\n uri = options.scheme + ':' + uri\n } else {\n uri = '//' + uri\n }\n }\n\n const matches = uri.match(URI_PARSE)\n\n if (matches) {\n // store each component\n parsed.scheme = matches[1]\n parsed.userinfo = matches[3]\n parsed.host = matches[4]\n parsed.port = parseInt(matches[5], 10)\n parsed.path = matches[6] || ''\n parsed.query = matches[7]\n parsed.fragment = matches[8]\n\n // fix port number\n if (isNaN(parsed.port)) {\n parsed.port = matches[5]\n }\n\n const parseError = getParseError(parsed, matches)\n if (parseError !== undefined) {\n parsed.error = parsed.error || parseError\n malformedAuthorityOrPort = true\n }\n\n if (parsed.host) {\n const ipv4result = isIPv4(parsed.host)\n if (ipv4result === false) {\n const ipv6result = normalizeIPv6(parsed.host)\n parsed.host = ipv6result.host.toLowerCase()\n isIP = ipv6result.isIPV6\n } else {\n isIP = true\n }\n }\n if (parsed.scheme === undefined && parsed.userinfo === undefined && parsed.host === undefined && parsed.port === undefined && parsed.query === undefined && !parsed.path) {\n parsed.reference = 'same-document'\n } else if (parsed.scheme === undefined) {\n parsed.reference = 'relative'\n } else if (parsed.fragment === undefined) {\n parsed.reference = 'absolute'\n } else {\n parsed.reference = 'uri'\n }\n\n // check for reference errors\n if (options.reference && options.reference !== 'suffix' && options.reference !== parsed.reference) {\n parsed.error = parsed.error || 'URI is not a ' + options.reference + ' reference.'\n }\n\n // find scheme handler\n const schemeHandler = getSchemeHandler(options.scheme || parsed.scheme)\n\n // check if scheme can't handle IRIs\n if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {\n // if host component is a domain name\n if (parsed.host && (options.domainHost || (schemeHandler && schemeHandler.domainHost)) && isIP === false && nonSimpleDomain(parsed.host)) {\n // convert Unicode IDN -> ASCII IDN\n try {\n parsed.host = URL.domainToASCII(parsed.host.toLowerCase())\n } catch (e) {\n parsed.error = parsed.error || \"Host's domain name can not be converted to ASCII: \" + e\n }\n }\n // convert IRI -> URI\n }\n\n if (!schemeHandler || (schemeHandler && !schemeHandler.skipNormalize)) {\n if (uri.indexOf('%') !== -1) {\n if (parsed.scheme !== undefined) {\n parsed.scheme = unescape(parsed.scheme)\n }\n if (parsed.host !== undefined) {\n parsed.host = reescapeHostDelimiters(unescape(parsed.host), isIP)\n }\n }\n if (parsed.path) {\n parsed.path = normalizePathEncoding(parsed.path)\n }\n if (parsed.fragment) {\n try {\n parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment))\n } catch {\n parsed.error = parsed.error || 'URI malformed'\n }\n }\n }\n\n // perform scheme specific parsing\n if (schemeHandler && schemeHandler.parse) {\n schemeHandler.parse(parsed, options)\n }\n } else {\n parsed.error = parsed.error || 'URI can not be parsed.'\n }\n return { parsed, malformedAuthorityOrPort }\n}\n\n/**\n * @param {string} uri\n * @param {import('./types/index').Options} [opts]\n * @returns\n */\nfunction parse (uri, opts) {\n return parseWithStatus(uri, opts).parsed\n}\n\n/**\n * @param {string} uri\n * @param {import('./types/index').Options} [opts]\n * @returns {string}\n */\nfunction normalizeString (uri, opts) {\n return normalizeStringWithStatus(uri, opts).normalized\n}\n\n/**\n * @param {string} uri\n * @param {import('./types/index').Options} [opts]\n * @returns {{ normalized: string, malformedAuthorityOrPort: boolean }}\n */\nfunction normalizeStringWithStatus (uri, opts) {\n const { parsed, malformedAuthorityOrPort } = parseWithStatus(uri, opts)\n return {\n normalized: malformedAuthorityOrPort ? uri : serialize(parsed, opts),\n malformedAuthorityOrPort\n }\n}\n\n/**\n * @param {import ('./types/index').URIComponent|string} uri\n * @param {import('./types/index').Options} [opts]\n * @returns {string|undefined}\n */\nfunction normalizeComparableURI (uri, opts) {\n if (typeof uri === 'string') {\n const { normalized, malformedAuthorityOrPort } = normalizeStringWithStatus(uri, opts)\n return malformedAuthorityOrPort ? undefined : normalized\n }\n\n if (typeof uri === 'object') {\n return serialize(uri, opts)\n }\n}\n\nconst fastUri = {\n SCHEMES,\n normalize,\n resolve,\n resolveComponent,\n equal,\n serialize,\n parse\n}\n\nmodule.exports = fastUri\nmodule.exports.default = fastUri\nmodule.exports.fastUri = fastUri\n", "import * as uri from \"fast-uri\"\n\ntype URI = typeof uri & {code: string}\n;(uri as URI).code = 'require(\"ajv/dist/runtime/uri\").default'\n\nexport default uri as URI\n", "export {\n Format,\n FormatDefinition,\n AsyncFormatDefinition,\n KeywordDefinition,\n KeywordErrorDefinition,\n CodeKeywordDefinition,\n MacroKeywordDefinition,\n FuncKeywordDefinition,\n Vocabulary,\n Schema,\n SchemaObject,\n AnySchemaObject,\n AsyncSchema,\n AnySchema,\n ValidateFunction,\n AsyncValidateFunction,\n AnyValidateFunction,\n ErrorObject,\n ErrorNoParams,\n} from \"./types\"\n\nexport {SchemaCxt, SchemaObjCxt} from \"./compile\"\nexport interface Plugin<Opts> {\n (ajv: Ajv, options?: Opts): Ajv\n [prop: string]: any\n}\n\nexport {KeywordCxt} from \"./compile/validate\"\nexport {DefinedError} from \"./vocabularies/errors\"\nexport {JSONType} from \"./compile/rules\"\nexport {JSONSchemaType} from \"./types/json-schema\"\nexport {JTDSchemaType, SomeJTDSchemaType, JTDDataType} from \"./types/jtd-schema\"\nexport {_, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions} from \"./compile/codegen\"\n\nimport type {\n Schema,\n AnySchema,\n AnySchemaObject,\n SchemaObject,\n AsyncSchema,\n Vocabulary,\n KeywordDefinition,\n AddedKeywordDefinition,\n AnyValidateFunction,\n ValidateFunction,\n AsyncValidateFunction,\n ErrorObject,\n Format,\n AddedFormat,\n RegExpEngine,\n UriResolver,\n} from \"./types\"\nimport type {JSONSchemaType} from \"./types/json-schema\"\nimport type {JTDSchemaType, SomeJTDSchemaType, JTDDataType} from \"./types/jtd-schema\"\nimport ValidationError from \"./runtime/validation_error\"\nimport MissingRefError from \"./compile/ref_error\"\nimport {getRules, ValidationRules, Rule, RuleGroup, JSONType} from \"./compile/rules\"\nimport {SchemaEnv, compileSchema, resolveSchema} from \"./compile\"\nimport {Code, ValueScope} from \"./compile/codegen\"\nimport {normalizeId, getSchemaRefs} from \"./compile/resolve\"\nimport {getJSONTypes} from \"./compile/validate/dataType\"\nimport {eachItem} from \"./compile/util\"\nimport * as $dataRefSchema from \"./refs/data.json\"\n\nimport DefaultUriResolver from \"./runtime/uri\"\n\nconst defaultRegExp: RegExpEngine = (str, flags) => new RegExp(str, flags)\ndefaultRegExp.code = \"new RegExp\"\n\nconst META_IGNORE_OPTIONS: (keyof Options)[] = [\"removeAdditional\", \"useDefaults\", \"coerceTypes\"]\nconst EXT_SCOPE_NAMES = new Set([\n \"validate\",\n \"serialize\",\n \"parse\",\n \"wrapper\",\n \"root\",\n \"schema\",\n \"keyword\",\n \"pattern\",\n \"formats\",\n \"validate$data\",\n \"func\",\n \"obj\",\n \"Error\",\n])\n\nexport type Options = CurrentOptions & DeprecatedOptions\n\nexport interface CurrentOptions {\n // strict mode options (NEW)\n strict?: boolean | \"log\"\n strictSchema?: boolean | \"log\"\n strictNumbers?: boolean | \"log\"\n strictTypes?: boolean | \"log\"\n strictTuples?: boolean | \"log\"\n strictRequired?: boolean | \"log\"\n allowMatchingProperties?: boolean // disables a strict mode restriction\n allowUnionTypes?: boolean\n validateFormats?: boolean\n // validation and reporting options:\n $data?: boolean\n allErrors?: boolean\n verbose?: boolean\n discriminator?: boolean\n unicodeRegExp?: boolean\n timestamp?: \"string\" | \"date\" // JTD only\n parseDate?: boolean // JTD only\n allowDate?: boolean // JTD only\n specialNumbers?: \"fast\" | \"null\" // JTD only\n $comment?:\n | true\n | ((comment: string, schemaPath?: string, rootSchema?: AnySchemaObject) => unknown)\n formats?: {[Name in string]?: Format}\n keywords?: Vocabulary\n schemas?: AnySchema[] | {[Key in string]?: AnySchema}\n logger?: Logger | false\n loadSchema?: (uri: string) => Promise<AnySchemaObject>\n // options to modify validated data:\n removeAdditional?: boolean | \"all\" | \"failing\"\n useDefaults?: boolean | \"empty\"\n coerceTypes?: boolean | \"array\"\n // advanced options:\n next?: boolean // NEW\n unevaluated?: boolean // NEW\n dynamicRef?: boolean // NEW\n schemaId?: \"id\" | \"$id\"\n jtd?: boolean // NEW\n meta?: SchemaObject | boolean\n defaultMeta?: string | AnySchemaObject\n validateSchema?: boolean | \"log\"\n addUsedSchema?: boolean\n inlineRefs?: boolean | number\n passContext?: boolean\n loopRequired?: number\n loopEnum?: number // NEW\n ownProperties?: boolean\n multipleOfPrecision?: number\n int32range?: boolean // JTD only\n messages?: boolean\n code?: CodeOptions // NEW\n uriResolver?: UriResolver\n}\n\nexport interface CodeOptions {\n es5?: boolean\n esm?: boolean\n lines?: boolean\n optimize?: boolean | number\n formats?: Code // code to require (or construct) map of available formats - for standalone code\n source?: boolean\n process?: (code: string, schema?: SchemaEnv) => string\n regExp?: RegExpEngine\n}\n\ninterface InstanceCodeOptions extends CodeOptions {\n regExp: RegExpEngine\n optimize: number\n}\n\ninterface DeprecatedOptions {\n /** @deprecated */\n ignoreKeywordsWithRef?: boolean\n /** @deprecated */\n jsPropertySyntax?: boolean // added instead of jsonPointers\n /** @deprecated */\n unicode?: boolean\n}\n\ninterface RemovedOptions {\n format?: boolean\n errorDataPath?: \"object\" | \"property\"\n nullable?: boolean // \"nullable\" keyword is supported by default\n jsonPointers?: boolean\n extendRefs?: true | \"ignore\" | \"fail\"\n missingRefs?: true | \"ignore\" | \"fail\"\n processCode?: (code: string, schema?: SchemaEnv) => string\n sourceCode?: boolean\n strictDefaults?: boolean\n strictKeywords?: boolean\n uniqueItems?: boolean\n unknownFormats?: true | string[] | \"ignore\"\n cache?: any\n serialize?: (schema: AnySchema) => unknown\n ajvErrors?: boolean\n}\n\ntype OptionsInfo<T extends RemovedOptions | DeprecatedOptions> = {\n [K in keyof T]-?: string | undefined\n}\n\nconst removedOptions: OptionsInfo<RemovedOptions> = {\n errorDataPath: \"\",\n format: \"`validateFormats: false` can be used instead.\",\n nullable: '\"nullable\" keyword is supported by default.',\n jsonPointers: \"Deprecated jsPropertySyntax can be used instead.\",\n extendRefs: \"Deprecated ignoreKeywordsWithRef can be used instead.\",\n missingRefs: \"Pass empty schema with $id that should be ignored to ajv.addSchema.\",\n processCode: \"Use option `code: {process: (code, schemaEnv: object) => string}`\",\n sourceCode: \"Use option `code: {source: true}`\",\n strictDefaults: \"It is default now, see option `strict`.\",\n strictKeywords: \"It is default now, see option `strict`.\",\n uniqueItems: '\"uniqueItems\" keyword is always validated.',\n unknownFormats: \"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).\",\n cache: \"Map is used as cache, schema object as key.\",\n serialize: \"Map is used as cache, schema object as key.\",\n ajvErrors: \"It is default now.\",\n}\n\nconst deprecatedOptions: OptionsInfo<DeprecatedOptions> = {\n ignoreKeywordsWithRef: \"\",\n jsPropertySyntax: \"\",\n unicode: '\"minLength\"/\"maxLength\" account for unicode characters by default.',\n}\n\ntype RequiredInstanceOptions = {\n [K in\n | \"strictSchema\"\n | \"strictNumbers\"\n | \"strictTypes\"\n | \"strictTuples\"\n | \"strictRequired\"\n | \"inlineRefs\"\n | \"loopRequired\"\n | \"loopEnum\"\n | \"meta\"\n | \"messages\"\n | \"schemaId\"\n | \"addUsedSchema\"\n | \"validateSchema\"\n | \"validateFormats\"\n | \"int32range\"\n | \"unicodeRegExp\"\n | \"uriResolver\"]: NonNullable<Options[K]>\n} & {code: InstanceCodeOptions}\n\nexport type InstanceOptions = Options & RequiredInstanceOptions\n\nconst MAX_EXPRESSION = 200\n\n// eslint-disable-next-line complexity\nfunction requiredOptions(o: Options): RequiredInstanceOptions {\n const s = o.strict\n const _optz = o.code?.optimize\n const optimize = _optz === true || _optz === undefined ? 1 : _optz || 0\n const regExp = o.code?.regExp ?? defaultRegExp\n const uriResolver = o.uriResolver ?? DefaultUriResolver\n return {\n strictSchema: o.strictSchema ?? s ?? true,\n strictNumbers: o.strictNumbers ?? s ?? true,\n strictTypes: o.strictTypes ?? s ?? \"log\",\n strictTuples: o.strictTuples ?? s ?? \"log\",\n strictRequired: o.strictRequired ?? s ?? false,\n code: o.code ? {...o.code, optimize, regExp} : {optimize, regExp},\n loopRequired: o.loopRequired ?? MAX_EXPRESSION,\n loopEnum: o.loopEnum ?? MAX_EXPRESSION,\n meta: o.meta ?? true,\n messages: o.messages ?? true,\n inlineRefs: o.inlineRefs ?? true,\n schemaId: o.schemaId ?? \"$id\",\n addUsedSchema: o.addUsedSchema ?? true,\n validateSchema: o.validateSchema ?? true,\n validateFormats: o.validateFormats ?? true,\n unicodeRegExp: o.unicodeRegExp ?? true,\n int32range: o.int32range ?? true,\n uriResolver: uriResolver,\n }\n}\n\nexport interface Logger {\n log(...args: unknown[]): unknown\n warn(...args: unknown[]): unknown\n error(...args: unknown[]): unknown\n}\n\nexport default class Ajv {\n opts: InstanceOptions\n errors?: ErrorObject[] | null // errors from the last validation\n logger: Logger\n // shared external scope values for compiled functions\n readonly scope: ValueScope\n readonly schemas: {[Key in string]?: SchemaEnv} = {}\n readonly refs: {[Ref in string]?: SchemaEnv | string} = {}\n readonly formats: {[Name in string]?: AddedFormat} = Object.create(null)\n readonly RULES: ValidationRules\n readonly _compilations: Set<SchemaEnv> = new Set()\n private readonly _loading: {[Ref in string]?: Promise<AnySchemaObject>} = {}\n private readonly _cache: Map<AnySchema, SchemaEnv> = new Map()\n private readonly _metaOpts: InstanceOptions\n\n static ValidationError = ValidationError\n static MissingRefError = MissingRefError\n\n constructor(opts: Options = {}) {\n opts = this.opts = {...opts, ...requiredOptions(opts)}\n const {es5, lines} = this.opts.code\n\n this.scope = new ValueScope({scope: {}, prefixes: EXT_SCOPE_NAMES, es5, lines})\n this.logger = getLogger(opts.logger)\n const formatOpt = opts.validateFormats\n opts.validateFormats = false\n\n this.RULES = getRules()\n checkOptions.call(this, removedOptions, opts, \"NOT SUPPORTED\")\n checkOptions.call(this, deprecatedOptions, opts, \"DEPRECATED\", \"warn\")\n this._metaOpts = getMetaSchemaOptions.call(this)\n\n if (opts.formats) addInitialFormats.call(this)\n this._addVocabularies()\n this._addDefaultMetaSchema()\n if (opts.keywords) addInitialKeywords.call(this, opts.keywords)\n if (typeof opts.meta == \"object\") this.addMetaSchema(opts.meta)\n addInitialSchemas.call(this)\n opts.validateFormats = formatOpt\n }\n\n _addVocabularies(): void {\n this.addKeyword(\"$async\")\n }\n\n _addDefaultMetaSchema(): void {\n const {$data, meta, schemaId} = this.opts\n let _dataRefSchema: SchemaObject = $dataRefSchema\n if (schemaId === \"id\") {\n _dataRefSchema = {...$dataRefSchema}\n _dataRefSchema.id = _dataRefSchema.$id\n delete _dataRefSchema.$id\n }\n if (meta && $data) this.addMetaSchema(_dataRefSchema, _dataRefSchema[schemaId], false)\n }\n\n defaultMeta(): string | AnySchemaObject | undefined {\n const {meta, schemaId} = this.opts\n return (this.opts.defaultMeta = typeof meta == \"object\" ? meta[schemaId] || meta : undefined)\n }\n\n // Validate data using schema\n // AnySchema will be compiled and cached using schema itself as a key for Map\n validate(schema: Schema | string, data: unknown): boolean\n validate(schemaKeyRef: AnySchema | string, data: unknown): boolean | Promise<unknown>\n validate<T>(schema: Schema | JSONSchemaType<T> | string, data: unknown): data is T\n // Separated for type inference to work\n // eslint-disable-next-line @typescript-eslint/unified-signatures\n validate<T>(schema: JTDSchemaType<T>, data: unknown): data is T\n // This overload is only intended for typescript inference, the first\n // argument prevents manual type annotation from matching this overload\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n validate<N extends never, T extends SomeJTDSchemaType>(\n schema: T,\n data: unknown\n ): data is JTDDataType<T>\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n validate<T>(schema: AsyncSchema, data: unknown | T): Promise<T>\n validate<T>(schemaKeyRef: AnySchema | string, data: unknown): data is T | Promise<T>\n validate<T>(\n schemaKeyRef: AnySchema | string, // key, ref or schema object\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n data: unknown | T // to be validated\n ): boolean | Promise<T> {\n let v: AnyValidateFunction | undefined\n if (typeof schemaKeyRef == \"string\") {\n v = this.getSchema<T>(schemaKeyRef)\n if (!v) throw new Error(`no schema with key or ref \"${schemaKeyRef}\"`)\n } else {\n v = this.compile<T>(schemaKeyRef)\n }\n\n const valid = v(data)\n if (!(\"$async\" in v)) this.errors = v.errors\n return valid\n }\n\n // Create validation function for passed schema\n // _meta: true if schema is a meta-schema. Used internally to compile meta schemas of user-defined keywords.\n compile<T = unknown>(schema: Schema | JSONSchemaType<T>, _meta?: boolean): ValidateFunction<T>\n // Separated for type inference to work\n // eslint-disable-next-line @typescript-eslint/unified-signatures\n compile<T = unknown>(schema: JTDSchemaType<T>, _meta?: boolean): ValidateFunction<T>\n // This overload is only intended for typescript inference, the first\n // argument prevents manual type annotation from matching this overload\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n compile<N extends never, T extends SomeJTDSchemaType>(\n schema: T,\n _meta?: boolean\n ): ValidateFunction<JTDDataType<T>>\n compile<T = unknown>(schema: AsyncSchema, _meta?: boolean): AsyncValidateFunction<T>\n compile<T = unknown>(schema: AnySchema, _meta?: boolean): AnyValidateFunction<T>\n compile<T = unknown>(schema: AnySchema, _meta?: boolean): AnyValidateFunction<T> {\n const sch = this._addSchema(schema, _meta)\n return (sch.validate || this._compileSchemaEnv(sch)) as AnyValidateFunction<T>\n }\n\n // Creates validating function for passed schema with asynchronous loading of missing schemas.\n // `loadSchema` option should be a function that accepts schema uri and returns promise that resolves with the schema.\n // TODO allow passing schema URI\n // meta - optional true to compile meta-schema\n compileAsync<T = unknown>(\n schema: SchemaObject | JSONSchemaType<T>,\n _meta?: boolean\n ): Promise<ValidateFunction<T>>\n // Separated for type inference to work\n // eslint-disable-next-line @typescript-eslint/unified-signatures\n compileAsync<T = unknown>(schema: JTDSchemaType<T>, _meta?: boolean): Promise<ValidateFunction<T>>\n compileAsync<T = unknown>(schema: AsyncSchema, meta?: boolean): Promise<AsyncValidateFunction<T>>\n // eslint-disable-next-line @typescript-eslint/unified-signatures\n compileAsync<T = unknown>(\n schema: AnySchemaObject,\n meta?: boolean\n ): Promise<AnyValidateFunction<T>>\n compileAsync<T = unknown>(\n schema: AnySchemaObject,\n meta?: boolean\n ): Promise<AnyValidateFunction<T>> {\n if (typeof this.opts.loadSchema != \"function\") {\n throw new Error(\"options.loadSchema should be a function\")\n }\n const {loadSchema} = this.opts\n return runCompileAsync.call(this, schema, meta)\n\n async function runCompileAsync(\n this: Ajv,\n _schema: AnySchemaObject,\n _meta?: boolean\n ): Promise<AnyValidateFunction> {\n await loadMetaSchema.call(this, _schema.$schema)\n const sch = this._addSchema(_schema, _meta)\n return sch.validate || _compileAsync.call(this, sch)\n }\n\n async function loadMetaSchema(this: Ajv, $ref?: string): Promise<void> {\n if ($ref && !this.getSchema($ref)) {\n await runCompileAsync.call(this, {$ref}, true)\n }\n }\n\n async function _compileAsync(this: Ajv, sch: SchemaEnv): Promise<AnyValidateFunction> {\n try {\n return this._compileSchemaEnv(sch)\n } catch (e) {\n if (!(e instanceof MissingRefError)) throw e\n checkLoaded.call(this, e)\n await loadMissingSchema.call(this, e.missingSchema)\n return _compileAsync.call(this, sch)\n }\n }\n\n function checkLoaded(this: Ajv, {missingSchema: ref, missingRef}: MissingRefError): void {\n if (this.refs[ref]) {\n throw new Error(`AnySchema ${ref} is loaded but ${missingRef} cannot be resolved`)\n }\n }\n\n async function loadMissingSchema(this: Ajv, ref: string): Promise<void> {\n const _schema = await _loadSchema.call(this, ref)\n if (!this.refs[ref]) await loadMetaSchema.call(this, _schema.$schema)\n if (!this.refs[ref]) this.addSchema(_schema, ref, meta)\n }\n\n async function _loadSchema(this: Ajv, ref: string): Promise<AnySchemaObject> {\n const p = this._loading[ref]\n if (p) return p\n try {\n return await (this._loading[ref] = loadSchema(ref))\n } finally {\n delete this._loading[ref]\n }\n }\n }\n\n // Adds schema to the instance\n addSchema(\n schema: AnySchema | AnySchema[], // If array is passed, `key` will be ignored\n key?: string, // Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`.\n _meta?: boolean, // true if schema is a meta-schema. Used internally, addMetaSchema should be used instead.\n _validateSchema = this.opts.validateSchema // false to skip schema validation. Used internally, option validateSchema should be used instead.\n ): Ajv {\n if (Array.isArray(schema)) {\n for (const sch of schema) this.addSchema(sch, undefined, _meta, _validateSchema)\n return this\n }\n let id: string | undefined\n if (typeof schema === \"object\") {\n const {schemaId} = this.opts\n id = schema[schemaId]\n if (id !== undefined && typeof id != \"string\") {\n throw new Error(`schema ${schemaId} must be string`)\n }\n }\n key = normalizeId(key || id)\n this._checkUnique(key)\n this.schemas[key] = this._addSchema(schema, _meta, key, _validateSchema, true)\n return this\n }\n\n // Add schema that will be used to validate other schemas\n // options in META_IGNORE_OPTIONS are alway set to false\n addMetaSchema(\n schema: AnySchemaObject,\n key?: string, // schema key\n _validateSchema = this.opts.validateSchema // false to skip schema validation, can be used to override validateSchema option for meta-schema\n ): Ajv {\n this.addSchema(schema, key, true, _validateSchema)\n return this\n }\n\n // Validate schema against its meta-schema\n validateSchema(schema: AnySchema, throwOrLogError?: boolean): boolean | Promise<unknown> {\n if (typeof schema == \"boolean\") return true\n let $schema: string | AnySchemaObject | undefined\n $schema = schema.$schema\n if ($schema !== undefined && typeof $schema != \"string\") {\n throw new Error(\"$schema must be a string\")\n }\n $schema = $schema || this.opts.defaultMeta || this.defaultMeta()\n if (!$schema) {\n this.logger.warn(\"meta-schema not available\")\n this.errors = null\n return true\n }\n const valid = this.validate($schema, schema)\n if (!valid && throwOrLogError) {\n const message = \"schema is invalid: \" + this.errorsText()\n if (this.opts.validateSchema === \"log\") this.logger.error(message)\n else throw new Error(message)\n }\n return valid\n }\n\n // Get compiled schema by `key` or `ref`.\n // (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id)\n getSchema<T = unknown>(keyRef: string): AnyValidateFunction<T> | undefined {\n let sch\n while (typeof (sch = getSchEnv.call(this, keyRef)) == \"string\") keyRef = sch\n if (sch === undefined) {\n const {schemaId} = this.opts\n const root = new SchemaEnv({schema: {}, schemaId})\n sch = resolveSchema.call(this, root, keyRef)\n if (!sch) return\n this.refs[keyRef] = sch\n }\n return (sch.validate || this._compileSchemaEnv(sch)) as AnyValidateFunction<T> | undefined\n }\n\n // Remove cached schema(s).\n // If no parameter is passed all schemas but meta-schemas are removed.\n // If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed.\n // Even if schema is referenced by other schemas it still can be removed as other schemas have local references.\n removeSchema(schemaKeyRef?: AnySchema | string | RegExp): Ajv {\n if (schemaKeyRef instanceof RegExp) {\n this._removeAllSchemas(this.schemas, schemaKeyRef)\n this._removeAllSchemas(this.refs, schemaKeyRef)\n return this\n }\n switch (typeof schemaKeyRef) {\n case \"undefined\":\n this._removeAllSchemas(this.schemas)\n this._removeAllSchemas(this.refs)\n this._cache.clear()\n return this\n case \"string\": {\n const sch = getSchEnv.call(this, schemaKeyRef)\n if (typeof sch == \"object\") this._cache.delete(sch.schema)\n delete this.schemas[schemaKeyRef]\n delete this.refs[schemaKeyRef]\n return this\n }\n case \"object\": {\n const cacheKey = schemaKeyRef\n this._cache.delete(cacheKey)\n let id = schemaKeyRef[this.opts.schemaId]\n if (id) {\n id = normalizeId(id)\n delete this.schemas[id]\n delete this.refs[id]\n }\n return this\n }\n default:\n throw new Error(\"ajv.removeSchema: invalid parameter\")\n }\n }\n\n // add \"vocabulary\" - a collection of keywords\n addVocabulary(definitions: Vocabulary): Ajv {\n for (const def of definitions) this.addKeyword(def)\n return this\n }\n\n addKeyword(\n kwdOrDef: string | KeywordDefinition,\n def?: KeywordDefinition // deprecated\n ): Ajv {\n let keyword: string | string[]\n if (typeof kwdOrDef == \"string\") {\n keyword = kwdOrDef\n if (typeof def == \"object\") {\n this.logger.warn(\"these parameters are deprecated, see docs for addKeyword\")\n def.keyword = keyword\n }\n } else if (typeof kwdOrDef == \"object\" && def === undefined) {\n def = kwdOrDef\n keyword = def.keyword\n if (Array.isArray(keyword) && !keyword.length) {\n throw new Error(\"addKeywords: keyword must be string or non-empty array\")\n }\n } else {\n throw new Error(\"invalid addKeywords parameters\")\n }\n\n checkKeyword.call(this, keyword, def)\n if (!def) {\n eachItem(keyword, (kwd) => addRule.call(this, kwd))\n return this\n }\n keywordMetaschema.call(this, def)\n const definition: AddedKeywordDefinition = {\n ...def,\n type: getJSONTypes(def.type),\n schemaType: getJSONTypes(def.schemaType),\n }\n eachItem(\n keyword,\n definition.type.length === 0\n ? (k) => addRule.call(this, k, definition)\n : (k) => definition.type.forEach((t) => addRule.call(this, k, definition, t))\n )\n return this\n }\n\n getKeyword(keyword: string): AddedKeywordDefinition | boolean {\n const rule = this.RULES.all[keyword]\n return typeof rule == \"object\" ? rule.definition : !!rule\n }\n\n // Remove keyword\n removeKeyword(keyword: string): Ajv {\n // TODO return type should be Ajv\n const {RULES} = this\n delete RULES.keywords[keyword]\n delete RULES.all[keyword]\n for (const group of RULES.rules) {\n const i = group.rules.findIndex((rule) => rule.keyword === keyword)\n if (i >= 0) group.rules.splice(i, 1)\n }\n return this\n }\n\n // Add format\n addFormat(name: string, format: Format): Ajv {\n if (typeof format == \"string\") format = new RegExp(format)\n this.formats[name] = format\n return this\n }\n\n errorsText(\n errors: ErrorObject[] | null | undefined = this.errors, // optional array of validation errors\n {separator = \", \", dataVar = \"data\"}: ErrorsTextOptions = {} // optional options with properties `separator` and `dataVar`\n ): string {\n if (!errors || errors.length === 0) return \"No errors\"\n return errors\n .map((e) => `${dataVar}${e.instancePath} ${e.message}`)\n .reduce((text, msg) => text + separator + msg)\n }\n\n $dataMetaSchema(metaSchema: AnySchemaObject, keywordsJsonPointers: string[]): AnySchemaObject {\n const rules = this.RULES.all\n metaSchema = JSON.parse(JSON.stringify(metaSchema))\n for (const jsonPointer of keywordsJsonPointers) {\n const segments = jsonPointer.split(\"/\").slice(1) // first segment is an empty string\n let keywords = metaSchema\n for (const seg of segments) keywords = keywords[seg] as AnySchemaObject\n\n for (const key in rules) {\n const rule = rules[key]\n if (typeof rule != \"object\") continue\n const {$data} = rule.definition\n const schema = keywords[key] as AnySchemaObject | undefined\n if ($data && schema) keywords[key] = schemaOrData(schema)\n }\n }\n\n return metaSchema\n }\n\n private _removeAllSchemas(schemas: {[Ref in string]?: SchemaEnv | string}, regex?: RegExp): void {\n for (const keyRef in schemas) {\n const sch = schemas[keyRef]\n if (!regex || regex.test(keyRef)) {\n if (typeof sch == \"string\") {\n delete schemas[keyRef]\n } else if (sch && !sch.meta) {\n this._cache.delete(sch.schema)\n delete schemas[keyRef]\n }\n }\n }\n }\n\n _addSchema(\n schema: AnySchema,\n meta?: boolean,\n baseId?: string,\n validateSchema = this.opts.validateSchema,\n addSchema = this.opts.addUsedSchema\n ): SchemaEnv {\n let id: string | undefined\n const {schemaId} = this.opts\n if (typeof schema == \"object\") {\n id = schema[schemaId]\n } else {\n if (this.opts.jtd) throw new Error(\"schema must be object\")\n else if (typeof schema != \"boolean\") throw new Error(\"schema must be object or boolean\")\n }\n let sch = this._cache.get(schema)\n if (sch !== undefined) return sch\n\n baseId = normalizeId(id || baseId)\n const localRefs = getSchemaRefs.call(this, schema, baseId)\n sch = new SchemaEnv({schema, schemaId, meta, baseId, localRefs})\n this._cache.set(sch.schema, sch)\n if (addSchema && !baseId.startsWith(\"#\")) {\n // TODO atm it is allowed to overwrite schemas without id (instead of not adding them)\n if (baseId) this._checkUnique(baseId)\n this.refs[baseId] = sch\n }\n if (validateSchema) this.validateSchema(schema, true)\n return sch\n }\n\n private _checkUnique(id: string): void {\n if (this.schemas[id] || this.refs[id]) {\n throw new Error(`schema with key or id \"${id}\" already exists`)\n }\n }\n\n private _compileSchemaEnv(sch: SchemaEnv): AnyValidateFunction {\n if (sch.meta) this._compileMetaSchema(sch)\n else compileSchema.call(this, sch)\n\n /* istanbul ignore if */\n if (!sch.validate) throw new Error(\"ajv implementation error\")\n return sch.validate\n }\n\n private _compileMetaSchema(sch: SchemaEnv): void {\n const currentOpts = this.opts\n this.opts = this._metaOpts\n try {\n compileSchema.call(this, sch)\n } finally {\n this.opts = currentOpts\n }\n }\n}\n\nexport interface ErrorsTextOptions {\n separator?: string\n dataVar?: string\n}\n\nfunction checkOptions(\n this: Ajv,\n checkOpts: OptionsInfo<RemovedOptions | DeprecatedOptions>,\n options: Options & RemovedOptions,\n msg: string,\n log: \"warn\" | \"error\" = \"error\"\n): void {\n for (const key in checkOpts) {\n const opt = key as keyof typeof checkOpts\n if (opt in options) this.logger[log](`${msg}: option ${key}. ${checkOpts[opt]}`)\n }\n}\n\nfunction getSchEnv(this: Ajv, keyRef: string): SchemaEnv | string | undefined {\n keyRef = normalizeId(keyRef) // TODO tests fail without this line\n return this.schemas[keyRef] || this.refs[keyRef]\n}\n\nfunction addInitialSchemas(this: Ajv): void {\n const optsSchemas = this.opts.schemas\n if (!optsSchemas) return\n if (Array.isArray(optsSchemas)) this.addSchema(optsSchemas)\n else for (const key in optsSchemas) this.addSchema(optsSchemas[key] as AnySchema, key)\n}\n\nfunction addInitialFormats(this: Ajv): void {\n for (const name in this.opts.formats) {\n const format = this.opts.formats[name]\n if (format) this.addFormat(name, format)\n }\n}\n\nfunction addInitialKeywords(\n this: Ajv,\n defs: Vocabulary | {[K in string]?: KeywordDefinition}\n): void {\n if (Array.isArray(defs)) {\n this.addVocabulary(defs)\n return\n }\n this.logger.warn(\"keywords option as map is deprecated, pass array\")\n for (const keyword in defs) {\n const def = defs[keyword] as KeywordDefinition\n if (!def.keyword) def.keyword = keyword\n this.addKeyword(def)\n }\n}\n\nfunction getMetaSchemaOptions(this: Ajv): InstanceOptions {\n const metaOpts = {...this.opts}\n for (const opt of META_IGNORE_OPTIONS) delete metaOpts[opt]\n return metaOpts\n}\n\nconst noLogs = {log() {}, warn() {}, error() {}}\n\nfunction getLogger(logger?: Partial<Logger> | false): Logger {\n if (logger === false) return noLogs\n if (logger === undefined) return console\n if (logger.log && logger.warn && logger.error) return logger as Logger\n throw new Error(\"logger must implement log, warn and error methods\")\n}\n\nconst KEYWORD_NAME = /^[a-z_$][a-z0-9_$:-]*$/i\n\nfunction checkKeyword(this: Ajv, keyword: string | string[], def?: KeywordDefinition): void {\n const {RULES} = this\n eachItem(keyword, (kwd) => {\n if (RULES.keywords[kwd]) throw new Error(`Keyword ${kwd} is already defined`)\n if (!KEYWORD_NAME.test(kwd)) throw new Error(`Keyword ${kwd} has invalid name`)\n })\n if (!def) return\n if (def.$data && !(\"code\" in def || \"validate\" in def)) {\n throw new Error('$data keyword must have \"code\" or \"validate\" function')\n }\n}\n\nfunction addRule(\n this: Ajv,\n keyword: string,\n definition?: AddedKeywordDefinition,\n dataType?: JSONType\n): void {\n const post = definition?.post\n if (dataType && post) throw new Error('keyword with \"post\" flag cannot have \"type\"')\n const {RULES} = this\n let ruleGroup = post ? RULES.post : RULES.rules.find(({type: t}) => t === dataType)\n if (!ruleGroup) {\n ruleGroup = {type: dataType, rules: []}\n RULES.rules.push(ruleGroup)\n }\n RULES.keywords[keyword] = true\n if (!definition) return\n\n const rule: Rule = {\n keyword,\n definition: {\n ...definition,\n type: getJSONTypes(definition.type),\n schemaType: getJSONTypes(definition.schemaType),\n },\n }\n if (definition.before) addBeforeRule.call(this, ruleGroup, rule, definition.before)\n else ruleGroup.rules.push(rule)\n RULES.all[keyword] = rule\n definition.implements?.forEach((kwd) => this.addKeyword(kwd))\n}\n\nfunction addBeforeRule(this: Ajv, ruleGroup: RuleGroup, rule: Rule, before: string): void {\n const i = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before)\n if (i >= 0) {\n ruleGroup.rules.splice(i, 0, rule)\n } else {\n ruleGroup.rules.push(rule)\n this.logger.warn(`rule ${before} is not defined`)\n }\n}\n\nfunction keywordMetaschema(this: Ajv, def: KeywordDefinition): void {\n let {metaSchema} = def\n if (metaSchema === undefined) return\n if (def.$data && this.opts.$data) metaSchema = schemaOrData(metaSchema)\n def.validateSchema = this.compile(metaSchema, true)\n}\n\nconst $dataRef = {\n $ref: \"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#\",\n}\n\nfunction schemaOrData(schema: AnySchema): AnySchemaObject {\n return {anyOf: [schema, $dataRef]}\n}\n", "import type {CodeKeywordDefinition} from \"../../types\"\n\nconst def: CodeKeywordDefinition = {\n keyword: \"id\",\n code() {\n throw new Error('NOT SUPPORTED: keyword \"id\", use \"$id\" for schema ID')\n },\n}\n\nexport default def\n", "import type {CodeKeywordDefinition, AnySchema} from \"../../types\"\nimport type {KeywordCxt} from \"../../compile/validate\"\nimport MissingRefError from \"../../compile/ref_error\"\nimport {callValidateCode} from \"../code\"\nimport {_, nil, stringify, Code, Name} from \"../../compile/codegen\"\nimport N from \"../../compile/names\"\nimport {SchemaEnv, resolveRef} from \"../../compile\"\nimport {mergeEvaluated} from \"../../compile/util\"\n\nconst def: CodeKeywordDefinition = {\n keyword: \"$ref\",\n schemaType: \"string\",\n code(cxt: KeywordCxt): void {\n const {gen, schema: $ref, it} = cxt\n const {baseId, schemaEnv: env, validateName, opts, self} = it\n const {root} = env\n if (($ref === \"#\" || $ref === \"#/\") && baseId === root.baseId) return callRootRef()\n const schOrEnv = resolveRef.call(self, root, baseId, $ref)\n if (schOrEnv === undefined) throw new MissingRefError(it.opts.uriResolver, baseId, $ref)\n if (schOrEnv instanceof SchemaEnv) return callValidate(schOrEnv)\n return inlineRefSchema(schOrEnv)\n\n function callRootRef(): void {\n if (env === root) return callRef(cxt, validateName, env, env.$async)\n const rootName = gen.scopeValue(\"root\", {ref: root})\n return callRef(cxt, _`${rootName}.validate`, root, root.$async)\n }\n\n function callValidate(sch: SchemaEnv): void {\n const v = getValidate(cxt, sch)\n callRef(cxt, v, sch, sch.$async)\n }\n\n function inlineRefSchema(sch: AnySchema): void {\n const schName = gen.scopeValue(\n \"schema\",\n opts.code.source === true ? {ref: sch, code: stringify(sch)} : {ref: sch}\n )\n const valid = gen.name(\"valid\")\n const schCxt = cxt.subschema(\n {\n schema: sch,\n dataTypes: [],\n schemaPath: nil,\n topSchemaRef: schName,\n errSchemaPath: $ref,\n },\n valid\n )\n cxt.mergeEvaluated(schCxt)\n cxt.ok(valid)\n }\n },\n}\n\nexport function getValidate(cxt: KeywordCxt, sch: SchemaEnv): Code {\n const {gen} = cxt\n return sch.validate\n ? gen.scopeValue(\"validate\", {ref: sch.validate})\n : _`${gen.scopeValue(\"wrapper\", {ref: sch})}.validate`\n}\n\nexport function callRef(cxt: KeywordCxt, v: Code, sch?: SchemaEnv, $async?: boolean): void {\n const {gen, it} = cxt\n const {allErrors, schemaEnv: env, opts} = it\n const passCxt = opts.passContext ? N.this : nil\n if ($async) callAsyncRef()\n else callSyncRef()\n\n function callAsyncRef(): void {\n if (!env.$async) throw new Error(\"async schema referenced by sync schema\")\n const valid = gen.let(\"valid\")\n gen.try(\n () => {\n gen.code(_`await ${callValidateCode(cxt, v, passCxt)}`)\n addEvaluatedFrom(v) // TODO will not work with async, it has to be returned with the result\n if (!allErrors) gen.assign(valid, true)\n },\n (e) => {\n gen.if(_`!(${e} instanceof ${it.ValidationError as Name})`, () => gen.throw(e))\n addErrorsFrom(e)\n if (!allErrors) gen.assign(valid, false)\n }\n )\n cxt.ok(valid)\n }\n\n function callSyncRef(): void {\n cxt.result(\n callValidateCode(cxt, v, passCxt),\n () => addEvaluatedFrom(v),\n () => addErrorsFrom(v)\n )\n }\n\n function addErrorsFrom(source: Code): void {\n const errs = _`${source}.errors`\n gen.assign(N.vErrors, _`${N.vErrors} === null ? ${errs} : ${N.vErrors}.concat(${errs})`) // TODO tagged\n gen.assign(N.errors, _`${N.vErrors}.length`)\n }\n\n function addEvaluatedFrom(source: Code): void {\n if (!it.opts.unevaluated) return\n const schEvaluated = sch?.validate?.evaluated\n // TODO refactor\n if (it.props !== true) {\n if (schEvaluated && !schEvaluated.dynamicProps) {\n if (schEvaluated.props !== undefined) {\n it.props = mergeEvaluated.props(gen, schEvaluated.props, it.props)\n }\n } else {\n const props = gen.var(\"props\", _`${source}.evaluated.props`)\n it.props = mergeEvaluated.props(gen, props, it.props, Name)\n }\n }\n if (it.items !== true) {\n if (schEvaluated && !schEvaluated.dynamicItems) {\n if (schEvaluated.items !== undefined) {\n it.items = mergeEvaluated.items(gen, schEvaluated.items, it.items)\n }\n } else {\n const items = gen.var(\"items\", _`${source}.evaluated.items`)\n it.items = mergeEvaluated.items(gen, items, it.items, Name)\n }\n }\n }\n}\n\nexport default def\n", "import type {Vocabulary} from \"../../types\"\nimport idKeyword from \"./id\"\nimport refKeyword from \"./ref\"\n\nconst core: Vocabulary = [\n \"$schema\",\n \"$id\",\n \"$defs\",\n \"$vocabulary\",\n {keyword: \"$comment\"},\n \"definitions\",\n idKeyword,\n refKeyword,\n]\n\nexport default core\n", "import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from \"../../types\"\nimport type {KeywordCxt} from \"../../compile/validate\"\nimport {_, str, operators, Code} from \"../../compile/codegen\"\n\nconst ops = operators\n\ntype Kwd = \"maximum\" | \"minimum\" | \"exclusiveMaximum\" | \"exclusiveMinimum\"\n\ntype Comparison = \"<=\" | \">=\" | \"<\" | \">\"\n\nconst KWDs: {[K in Kwd]: {okStr: Comparison; ok: Code; fail: Code}} = {\n maximum: {okStr: \"<=\", ok: ops.LTE, fail: ops.GT},\n minimum: {okStr: \">=\", ok: ops.GTE, fail: ops.LT},\n exclusiveMaximum: {okStr: \"<\", ok: ops.LT, fail: ops.GTE},\n exclusiveMinimum: {okStr: \">\", ok: ops.GT, fail: ops.LTE},\n}\n\nexport type LimitNumberError = ErrorObject<\n Kwd,\n {limit: number; comparison: Comparison},\n number | {$data: string}\n>\n\nconst error: KeywordErrorDefinition = {\n message: ({keyword, schemaCode}) => str`must be ${KWDs[keyword as Kwd].okStr} ${schemaCode}`,\n params: ({keyword, schemaCode}) =>\n _`{comparison: ${KWDs[keyword as Kwd].okStr}, limit: ${schemaCode}}`,\n}\n\nconst def: CodeKeywordDefinition = {\n keyword: Object.keys(KWDs),\n type: \"number\",\n schemaType: \"number\",\n $data: true,\n error,\n code(cxt: KeywordCxt) {\n const {keyword, data, schemaCode} = cxt\n cxt.fail$data(_`${data} ${KWDs[keyword as Kwd].fail} ${schemaCode} || isNaN(${data})`)\n },\n}\n\nexport default def\n", "import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from \"../../types\"\nimport type {KeywordCxt} from \"../../compile/validate\"\nimport {_, str} from \"../../compile/codegen\"\n\nexport type MultipleOfError = ErrorObject<\n \"multipleOf\",\n {multipleOf: number},\n number | {$data: string}\n>\n\nconst error: KeywordErrorDefinition = {\n message: ({schemaCode}) => str`must be multiple of ${schemaCode}`,\n params: ({schemaCode}) => _`{multipleOf: ${schemaCode}}`,\n}\n\nconst def: CodeKeywordDefinition = {\n keyword: \"multipleOf\",\n type: \"number\",\n schemaType: \"number\",\n $data: true,\n error,\n code(cxt: KeywordCxt) {\n const {gen, data, schemaCode, it} = cxt\n // const bdt = bad$DataType(schemaCode, <string>def.schemaType, $data)\n const prec = it.opts.multipleOfPrecision\n const res = gen.let(\"res\")\n const invalid = prec\n ? _`Math.abs(Math.round(${res}) - ${res}) > 1e-${prec}`\n : _`${res} !== parseInt(${res})`\n cxt.fail$data(_`(${schemaCode} === 0 || (${res} = ${data}/${schemaCode}, ${invalid}))`)\n },\n}\n\nexport default def\n", "// https://mathiasbynens.be/notes/javascript-encoding\n// https://github.com/bestiejs/punycode.js - punycode.ucs2.decode\nexport default function ucs2length(str: string): number {\n const len = str.length\n let length = 0\n let pos = 0\n let value: number\n while (pos < len) {\n length++\n value = str.charCodeAt(pos++)\n if (value >= 0xd800 && value <= 0xdbff && pos < len) {\n // high surrogate, and there is a next character\n value = str.charCodeAt(pos)\n if ((value & 0xfc00) === 0xdc00) pos++ // low surrogate\n }\n }\n return length\n}\n\nucs2length.code = 'require(\"ajv/dist/runtime/ucs2length\").default'\n", "import type {CodeKeywordDefinition, KeywordErrorDefinition} from \"../../types\"\nimport type {KeywordCxt} from \"../../compile/validate\"\nimport {_, str, operators} from \"../../compile/codegen\"\nimport {useFunc} from \"../../compile/util\"\nimport ucs2length from \"../../runtime/ucs2length\"\n\nconst error: KeywordErrorDefinition = {\n message({keyword, schemaCode}) {\n const comp = keyword === \"maxLength\" ? \"more\" : \"fewer\"\n return str`must NOT have ${comp} than ${schemaCode} characters`\n },\n params: ({schemaCode}) => _`{limit: ${schemaCode}}`,\n}\n\nconst def: CodeKeywordDefinition = {\n keyword: [\"maxLength\", \"minLength\"],\n type: \"string\",\n schemaType: \"number\",\n $data: true,\n error,\n code(cxt: KeywordCxt) {\n const {keyword, data, schemaCode, it} = cxt\n const op = keyword === \"maxLength\" ? operators.GT : operators.LT\n const len =\n it.opts.unicode === false ? _`${data}.length` : _`${useFunc(cxt.gen, ucs2length)}(${data})`\n cxt.fail$data(_`${len} ${op} ${schemaCode}`)\n },\n}\n\nexport default def\n", "import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from \"../../types\"\nimport type {KeywordCxt} from \"../../compile/validate\"\nimport {usePattern} from \"../code\"\nimport {useFunc} from \"../../compile/util\"\nimport {_, str} from \"../../compile/codegen\"\n\nexport type PatternError = ErrorObject<\"pattern\", {pattern: string}, string | {$data: string}>\n\nconst error: KeywordErrorDefinition = {\n message: ({schemaCode}) => str`must match pattern \"${schemaCode}\"`,\n params: ({schemaCode}) => _`{pattern: ${schemaCode}}`,\n}\n\nconst def: CodeKeywordDefinition = {\n keyword: \"pattern\",\n type: \"string\",\n schemaType: \"string\",\n $data: true,\n error,\n code(cxt: KeywordCxt) {\n const {gen, data, $data, schema, schemaCode, it} = cxt\n const u = it.opts.unicodeRegExp ? \"u\" : \"\"\n if ($data) {\n const {regExp} = it.opts.code\n const regExpCode = regExp.code === \"new RegExp\" ? _`new RegExp` : useFunc(gen, regExp)\n const valid = gen.let(\"valid\")\n gen.try(\n () => gen.assign(valid, _`${regExpCode}(${schemaCode}, ${u}).test(${data})`),\n () => gen.assign(valid, false)\n )\n cxt.fail$data(_`!${valid}`)\n } else {\n const regExp = usePattern(cxt, schema)\n cxt.fail$data(_`!${regExp}.test(${data})`)\n }\n },\n}\n\nexport default def\n", "import type {CodeKeywordDefinition, KeywordErrorDefinition} from \"../../types\"\nimport type {KeywordCxt} from \"../../compile/validate\"\nimport {_, str, operators} from \"../../compile/codegen\"\n\nconst error: KeywordErrorDefinition = {\n message({keyword, schemaCode}) {\n const comp = keyword === \"maxProperties\" ? \"more\" : \"fewer\"\n return str`must NOT have ${comp} than ${schemaCode} properties`\n },\n params: ({schemaCode}) => _`{limit: ${schemaCode}}`,\n}\n\nconst def: CodeKeywordDefinition = {\n keyword: [\"maxProperties\", \"minProperties\"],\n type: \"object\",\n schemaType: \"number\",\n $data: true,\n error,\n code(cxt: KeywordCxt) {\n const {keyword, data, schemaCode} = cxt\n const op = keyword === \"maxProperties\" ? operators.GT : operators.LT\n cxt.fail$data(_`Object.keys(${data}).length ${op} ${schemaCode}`)\n },\n}\n\nexport default def\n", "import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from \"../../types\"\nimport type {KeywordCxt} from \"../../compile/validate\"\nimport {\n checkReportMissingProp,\n checkMissingProp,\n reportMissingProp,\n propertyInData,\n noPropertyInData,\n} from \"../code\"\nimport {_, str, nil, not, Name, Code} from \"../../compile/codegen\"\nimport {checkStrictMode} from \"../../compile/util\"\n\nexport type RequiredError = ErrorObject<\n \"required\",\n {missingProperty: string},\n string[] | {$data: string}\n>\n\nconst error: KeywordErrorDefinition = {\n message: ({params: {missingProperty}}) => str`must have required property '${missingProperty}'`,\n params: ({params: {missingProperty}}) => _`{missingProperty: ${missingProperty}}`,\n}\n\nconst def: CodeKeywordDefinition = {\n keyword: \"required\",\n type: \"object\",\n schemaType: \"array\",\n $data: true,\n error,\n code(cxt: KeywordCxt) {\n const {gen, schema, schemaCode, data, $data, it} = cxt\n const {opts} = it\n if (!$data && schema.length === 0) return\n const useLoop = schema.length >= opts.loopRequired\n if (it.allErrors) allErrorsMode()\n else exitOnErrorMode()\n\n if (opts.strictRequired) {\n const props = cxt.parentSchema.properties\n const {definedProperties} = cxt.it\n for (const requiredKey of schema) {\n if (props?.[requiredKey] === undefined && !definedProperties.has(requiredKey)) {\n const schemaPath = it.schemaEnv.baseId + it.errSchemaPath\n const msg = `required property \"${requiredKey}\" is not defined at \"${schemaPath}\" (strictRequired)`\n checkStrictMode(it, msg, it.opts.strictRequired)\n }\n }\n }\n\n function allErrorsMode(): void {\n if (useLoop || $data) {\n cxt.block$data(nil, loopAllRequired)\n } else {\n for (const prop of schema) {\n checkReportMissingProp(cxt, prop)\n }\n }\n }\n\n function exitOnErrorMode(): void {\n const missing = gen.let(\"missing\")\n if (useLoop || $data) {\n const valid = gen.let(\"valid\", true)\n cxt.block$data(valid, () => loopUntilMissing(missing, valid))\n cxt.ok(valid)\n } else {\n gen.if(checkMissingProp(cxt, schema, missing))\n reportMissingProp(cxt, missing)\n gen.else()\n }\n }\n\n function loopAllRequired(): void {\n gen.forOf(\"prop\", schemaCode as Code, (prop) => {\n cxt.setParams({missingProperty: prop})\n gen.if(noPropertyInData(gen, data, prop, opts.ownProperties), () => cxt.error())\n })\n }\n\n function loopUntilMissing(missing: Name, valid: Name): void {\n cxt.setParams({missingProperty: missing})\n gen.forOf(\n missing,\n schemaCode as Code,\n () => {\n gen.assign(valid, propertyInData(gen, data, missing, opts.ownProperties))\n gen.if(not(valid), () => {\n cxt.error()\n gen.break()\n })\n },\n nil\n )\n }\n },\n}\n\nexport default def\n", "import type {CodeKeywordDefinition, KeywordErrorDefinition} from \"../../types\"\nimport type {KeywordCxt} from \"../../compile/validate\"\nimport {_, str, operators} from \"../../compile/codegen\"\n\nconst error: KeywordErrorDefinition = {\n message({keyword, schemaCode}) {\n const comp = keyword === \"maxItems\" ? \"more\" : \"fewer\"\n return str`must NOT have ${comp} than ${schemaCode} items`\n },\n params: ({schemaCode}) => _`{limit: ${schemaCode}}`,\n}\n\nconst def: CodeKeywordDefinition = {\n keyword: [\"maxItems\", \"minItems\"],\n type: \"array\",\n schemaType: \"number\",\n $data: true,\n error,\n code(cxt: KeywordCxt) {\n const {keyword, data, schemaCode} = cxt\n const op = keyword === \"maxItems\" ? operators.GT : operators.LT\n cxt.fail$data(_`${data}.length ${op} ${schemaCode}`)\n },\n}\n\nexport default def\n", "// https://github.com/ajv-validator/ajv/issues/889\nimport * as equal from \"fast-deep-equal\"\n\ntype Equal = typeof equal & {code: string}\n;(equal as Equal).code = 'require(\"ajv/dist/runtime/equal\").default'\n\nexport default equal as Equal\n", "import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from \"../../types\"\nimport type {KeywordCxt} from \"../../compile/validate\"\nimport {checkDataTypes, getSchemaTypes, DataType} from \"../../compile/validate/dataType\"\nimport {_, str, Name} from \"../../compile/codegen\"\nimport {useFunc} from \"../../compile/util\"\nimport equal from \"../../runtime/equal\"\n\nexport type UniqueItemsError = ErrorObject<\n \"uniqueItems\",\n {i: number; j: number},\n boolean | {$data: string}\n>\n\nconst error: KeywordErrorDefinition = {\n message: ({params: {i, j}}) =>\n str`must NOT have duplicate items (items ## ${j} and ${i} are identical)`,\n params: ({params: {i, j}}) => _`{i: ${i}, j: ${j}}`,\n}\n\nconst def: CodeKeywordDefinition = {\n keyword: \"uniqueItems\",\n type: \"array\",\n schemaType: \"boolean\",\n $data: true,\n error,\n code(cxt: KeywordCxt) {\n const {gen, data, $data, schema, parentSchema, schemaCode, it} = cxt\n if (!$data && !schema) return\n const valid = gen.let(\"valid\")\n const itemTypes = parentSchema.items ? getSchemaTypes(parentSchema.items) : []\n cxt.block$data(valid, validateUniqueItems, _`${schemaCode} === false`)\n cxt.ok(valid)\n\n function validateUniqueItems(): void {\n const i = gen.let(\"i\", _`${data}.length`)\n const j = gen.let(\"j\")\n cxt.setParams({i, j})\n gen.assign(valid, true)\n gen.if(_`${i} > 1`, () => (canOptimize() ? loopN : loopN2)(i, j))\n }\n\n function canOptimize(): boolean {\n return itemTypes.length > 0 && !itemTypes.some((t) => t === \"object\" || t === \"array\")\n }\n\n function loopN(i: Name, j: Name): void {\n const item = gen.name(\"item\")\n const wrongType = checkDataTypes(itemTypes, item, it.opts.strictNumbers, DataType.Wrong)\n const indices = gen.const(\"indices\", _`{}`)\n gen.for(_`;${i}--;`, () => {\n gen.let(item, _`${data}[${i}]`)\n gen.if(wrongType, _`continue`)\n if (itemTypes.length > 1) gen.if(_`typeof ${item} == \"string\"`, _`${item} += \"_\"`)\n gen\n .if(_`typeof ${indices}[${item}] == \"number\"`, () => {\n gen.assign(j, _`${indices}[${item}]`)\n cxt.error()\n gen.assign(valid, false).break()\n })\n .code(_`${indices}[${item}] = ${i}`)\n })\n }\n\n function loopN2(i: Name, j: Name): void {\n const eql = useFunc(gen, equal)\n const outer = gen.name(\"outer\")\n gen.label(outer).for(_`;${i}--;`, () =>\n gen.for(_`${j} = ${i}; ${j}--;`, () =>\n gen.if(_`${eql}(${data}[${i}], ${data}[${j}])`, () => {\n cxt.error()\n gen.assign(valid, false).break(outer)\n })\n )\n )\n }\n },\n}\n\nexport default def\n", "import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from \"../../types\"\nimport type {KeywordCxt} from \"../../compile/validate\"\nimport {_} from \"../../compile/codegen\"\nimport {useFunc} from \"../../compile/util\"\nimport equal from \"../../runtime/equal\"\n\nexport type ConstError = ErrorObject<\"const\", {allowedValue: any}>\n\nconst error: KeywordErrorDefinition = {\n message: \"must be equal to constant\",\n params: ({schemaCode}) => _`{allowedValue: ${schemaCode}}`,\n}\n\nconst def: CodeKeywordDefinition = {\n keyword: \"const\",\n $data: true,\n error,\n code(cxt: KeywordCxt) {\n const {gen, data, $data, schemaCode, schema} = cxt\n if ($data || (schema && typeof schema == \"object\")) {\n cxt.fail$data(_`!${useFunc(gen, equal)}(${data}, ${schemaCode})`)\n } else {\n cxt.fail(_`${schema} !== ${data}`)\n }\n },\n}\n\nexport default def\n", "import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from \"../../types\"\nimport type {KeywordCxt} from \"../../compile/validate\"\nimport {_, or, Name, Code} from \"../../compile/codegen\"\nimport {useFunc} from \"../../compile/util\"\nimport equal from \"../../runtime/equal\"\n\nexport type EnumError = ErrorObject<\"enum\", {allowedValues: any[]}, any[] | {$data: string}>\n\nconst error: KeywordErrorDefinition = {\n message: \"must be equal to one of the allowed values\",\n params: ({schemaCode}) => _`{allowedValues: ${schemaCode}}`,\n}\n\nconst def: CodeKeywordDefinition = {\n keyword: \"enum\",\n schemaType: \"array\",\n $data: true,\n error,\n code(cxt: KeywordCxt) {\n const {gen, data, $data, schema, schemaCode, it} = cxt\n if (!$data && schema.length === 0) throw new Error(\"enum must have non-empty array\")\n const useLoop = schema.length >= it.opts.loopEnum\n let eql: Name | undefined\n const getEql = (): Name => (eql ??= useFunc(gen, equal))\n\n let valid: Code\n if (useLoop || $data) {\n valid = gen.let(\"valid\")\n cxt.block$data(valid, loopEnum)\n } else {\n /* istanbul ignore if */\n if (!Array.isArray(schema)) throw new Error(\"ajv implementation error\")\n const vSchema = gen.const(\"vSchema\", schemaCode)\n valid = or(...schema.map((_x: unknown, i: number) => equalCode(vSchema, i)))\n }\n cxt.pass(valid)\n\n function loopEnum(): void {\n gen.assign(valid, false)\n gen.forOf(\"v\", schemaCode as Code, (v) =>\n gen.if(_`${getEql()}(${data}, ${v})`, () => gen.assign(valid, true).break())\n )\n }\n\n function equalCode(vSchema: Name, i: number): Code {\n const sch = schema[i]\n return typeof sch === \"object\" && sch !== null\n ? _`${getEql()}(${data}, ${vSchema}[${i}])`\n : _`${data} === ${sch}`\n }\n },\n}\n\nexport default def\n", "import type {ErrorObject, Vocabulary} from \"../../types\"\nimport limitNumber, {LimitNumberError} from \"./limitNumber\"\nimport multipleOf, {MultipleOfError} from \"./multipleOf\"\nimport limitLength from \"./limitLength\"\nimport pattern, {PatternError} from \"./pattern\"\nimport limitProperties from \"./limitProperties\"\nimport required, {RequiredError} from \"./required\"\nimport limitItems from \"./limitItems\"\nimport uniqueItems, {UniqueItemsError} from \"./uniqueItems\"\nimport constKeyword, {ConstError} from \"./const\"\nimport enumKeyword, {EnumError} from \"./enum\"\n\nconst validation: Vocabulary = [\n // number\n limitNumber,\n multipleOf,\n // string\n limitLength,\n pattern,\n // object\n limitProperties,\n required,\n // array\n limitItems,\n uniqueItems,\n // any\n {keyword: \"type\", schemaType: [\"string\", \"array\"]},\n {keyword: \"nullable\", schemaType: \"boolean\"},\n constKeyword,\n enumKeyword,\n]\n\nexport default validation\n\ntype LimitError = ErrorObject<\n \"maxItems\" | \"minItems\" | \"minProperties\" | \"maxProperties\" | \"minLength\" | \"maxLength\",\n {limit: number},\n number | {$data: string}\n>\n\nexport type ValidationKeywordError =\n | LimitError\n | LimitNumberError\n | MultipleOfError\n | PatternError\n | RequiredError\n | UniqueItemsError\n | ConstError\n | EnumError\n", "import type {\n CodeKeywordDefinition,\n ErrorObject,\n KeywordErrorDefinition,\n AnySchema,\n} from \"../../types\"\nimport type {KeywordCxt} from \"../../compile/validate\"\nimport {_, str, not, Name} from \"../../compile/codegen\"\nimport {alwaysValidSchema, checkStrictMode, Type} from \"../../compile/util\"\n\nexport type AdditionalItemsError = ErrorObject<\"additionalItems\", {limit: number}, AnySchema>\n\nconst error: KeywordErrorDefinition = {\n message: ({params: {len}}) => str`must NOT have more than ${len} items`,\n params: ({params: {len}}) => _`{limit: ${len}}`,\n}\n\nconst def: CodeKeywordDefinition = {\n keyword: \"additionalItems\" as const,\n type: \"array\",\n schemaType: [\"boolean\", \"object\"],\n before: \"uniqueItems\",\n error,\n code(cxt: KeywordCxt) {\n const {parentSchema, it} = cxt\n const {items} = parentSchema\n if (!Array.isArray(items)) {\n checkStrictMode(it, '\"additionalItems\" is ignored when \"items\" is not an array of schemas')\n return\n }\n validateAdditionalItems(cxt, items)\n },\n}\n\nexport function validateAdditionalItems(cxt: KeywordCxt, items: AnySchema[]): void {\n const {gen, schema, data, keyword, it} = cxt\n it.items = true\n const len = gen.const(\"len\", _`${data}.length`)\n if (schema === false) {\n cxt.setParams({len: items.length})\n cxt.pass(_`${len} <= ${items.length}`)\n } else if (typeof schema == \"object\" && !alwaysValidSchema(it, schema)) {\n const valid = gen.var(\"valid\", _`${len} <= ${items.length}`) // TODO var\n gen.if(not(valid), () => validateItems(valid))\n cxt.ok(valid)\n }\n\n function validateItems(valid: Name): void {\n gen.forRange(\"i\", items.length, len, (i) => {\n cxt.subschema({keyword, dataProp: i, dataPropType: Type.Num}, valid)\n if (!it.allErrors) gen.if(not(valid), () => gen.break())\n })\n }\n}\n\nexport default def\n", "import type {CodeKeywordDefinition, AnySchema, AnySchemaObject} from \"../../types\"\nimport type {KeywordCxt} from \"../../compile/validate\"\nimport {_} from \"../../compile/codegen\"\nimport {alwaysValidSchema, mergeEvaluated, checkStrictMode} from \"../../compile/util\"\nimport {validateArray} from \"../code\"\n\nconst def: CodeKeywordDefinition = {\n keyword: \"items\",\n type: \"array\",\n schemaType: [\"object\", \"array\", \"boolean\"],\n before: \"uniqueItems\",\n code(cxt: KeywordCxt) {\n const {schema, it} = cxt\n if (Array.isArray(schema)) return validateTuple(cxt, \"additionalItems\", schema)\n it.items = true\n if (alwaysValidSchema(it, schema)) return\n cxt.ok(validateArray(cxt))\n },\n}\n\nexport function validateTuple(\n cxt: KeywordCxt,\n extraItems: string,\n schArr: AnySchema[] = cxt.schema\n): void {\n const {gen, parentSchema, data, keyword, it} = cxt\n checkStrictTuple(parentSchema)\n if (it.opts.unevaluated && schArr.length && it.items !== true) {\n it.items = mergeEvaluated.items(gen, schArr.length, it.items)\n }\n const valid = gen.name(\"valid\")\n const len = gen.const(\"len\", _`${data}.length`)\n schArr.forEach((sch: AnySchema, i: number) => {\n if (alwaysValidSchema(it, sch)) return\n gen.if(_`${len} > ${i}`, () =>\n cxt.subschema(\n {\n keyword,\n schemaProp: i,\n dataProp: i,\n },\n valid\n )\n )\n cxt.ok(valid)\n })\n\n function checkStrictTuple(sch: AnySchemaObject): void {\n const {opts, errSchemaPath} = it\n const l = schArr.length\n const fullTuple = l === sch.minItems && (l === sch.maxItems || sch[extraItems] === false)\n if (opts.strictTuples && !fullTuple) {\n const msg = `\"${keyword}\" is ${l}-tuple, but minItems or maxItems/${extraItems} are not specified or different at path \"${errSchemaPath}\"`\n checkStrictMode(it, msg, opts.strictTuples)\n }\n }\n}\n\nexport default def\n", "import type {CodeKeywordDefinition} from \"../../types\"\nimport {validateTuple} from \"./items\"\n\nconst def: CodeKeywordDefinition = {\n keyword: \"prefixItems\",\n type: \"array\",\n schemaType: [\"array\"],\n before: \"uniqueItems\",\n code: (cxt) => validateTuple(cxt, \"items\"),\n}\n\nexport default def\n", "import type {\n CodeKeywordDefinition,\n KeywordErrorDefinition,\n ErrorObject,\n AnySchema,\n} from \"../../types\"\nimport type {KeywordCxt} from \"../../compile/validate\"\nimport {_, str} from \"../../compile/codegen\"\nimport {alwaysValidSchema} from \"../../compile/util\"\nimport {validateArray} from \"../code\"\nimport {validateAdditionalItems} from \"./additionalItems\"\n\nexport type ItemsError = ErrorObject<\"items\", {limit: number}, AnySchema>\n\nconst error: KeywordErrorDefinition = {\n message: ({params: {len}}) => str`must NOT have more than ${len} items`,\n params: ({params: {len}}) => _`{limit: ${len}}`,\n}\n\nconst def: CodeKeywordDefinition = {\n keyword: \"items\",\n type: \"array\",\n schemaType: [\"object\", \"boolean\"],\n before: \"uniqueItems\",\n error,\n code(cxt: KeywordCxt) {\n const {schema, parentSchema, it} = cxt\n const {prefixItems} = parentSchema\n it.items = true\n if (alwaysValidSchema(it, schema)) return\n if (prefixItems) validateAdditionalItems(cxt, prefixItems)\n else cxt.ok(validateArray(cxt))\n },\n}\n\nexport default def\n", "import type {\n CodeKeywordDefinition,\n KeywordErrorDefinition,\n ErrorObject,\n AnySchema,\n} from \"../../types\"\nimport type {KeywordCxt} from \"../../compile/validate\"\nimport {_, str, Name} from \"../../compile/codegen\"\nimport {alwaysValidSchema, checkStrictMode, Type} from \"../../compile/util\"\n\nexport type ContainsError = ErrorObject<\n \"contains\",\n {minContains: number; maxContains?: number},\n AnySchema\n>\n\nconst error: KeywordErrorDefinition = {\n message: ({params: {min, max}}) =>\n max === undefined\n ? str`must contain at least ${min} valid item(s)`\n : str`must contain at least ${min} and no more than ${max} valid item(s)`,\n params: ({params: {min, max}}) =>\n max === undefined ? _`{minContains: ${min}}` : _`{minContains: ${min}, maxContains: ${max}}`,\n}\n\nconst def: CodeKeywordDefinition = {\n keyword: \"contains\",\n type: \"array\",\n schemaType: [\"object\", \"boolean\"],\n before: \"uniqueItems\",\n trackErrors: true,\n error,\n code(cxt: KeywordCxt) {\n const {gen, schema, parentSchema, data, it} = cxt\n let min: number\n let max: number | undefined\n const {minContains, maxContains} = parentSchema\n if (it.opts.next) {\n min = minContains === undefined ? 1 : minContains\n max = maxContains\n } else {\n min = 1\n }\n const len = gen.const(\"len\", _`${data}.length`)\n cxt.setParams({min, max})\n if (max === undefined && min === 0) {\n checkStrictMode(it, `\"minContains\" == 0 without \"maxContains\": \"contains\" keyword ignored`)\n return\n }\n if (max !== undefined && min > max) {\n checkStrictMode(it, `\"minContains\" > \"maxContains\" is always invalid`)\n cxt.fail()\n return\n }\n if (alwaysValidSchema(it, schema)) {\n let cond = _`${len} >= ${min}`\n if (max !== undefined) cond = _`${cond} && ${len} <= ${max}`\n cxt.pass(cond)\n return\n }\n\n it.items = true\n const valid = gen.name(\"valid\")\n if (max === undefined && min === 1) {\n validateItems(valid, () => gen.if(valid, () => gen.break()))\n } else if (min === 0) {\n gen.let(valid, true)\n if (max !== undefined) gen.if(_`${data}.length > 0`, validateItemsWithCount)\n } else {\n gen.let(valid, false)\n validateItemsWithCount()\n }\n cxt.result(valid, () => cxt.reset())\n\n function validateItemsWithCount(): void {\n const schValid = gen.name(\"_valid\")\n const count = gen.let(\"count\", 0)\n validateItems(schValid, () => gen.if(schValid, () => checkLimits(count)))\n }\n\n function validateItems(_valid: Name, block: () => void): void {\n gen.forRange(\"i\", 0, len, (i) => {\n cxt.subschema(\n {\n keyword: \"contains\",\n dataProp: i,\n dataPropType: Type.Num,\n compositeRule: true,\n },\n _valid\n )\n block()\n })\n }\n\n function checkLimits(count: Name): void {\n gen.code(_`${count}++`)\n if (max === undefined) {\n gen.if(_`${count} >= ${min}`, () => gen.assign(valid, true).break())\n } else {\n gen.if(_`${count} > ${max}`, () => gen.assign(valid, false).break())\n if (min === 1) gen.assign(valid, true)\n else gen.if(_`${count} >= ${min}`, () => gen.assign(valid, true))\n }\n }\n },\n}\n\nexport default def\n", "import type {\n CodeKeywordDefinition,\n ErrorObject,\n KeywordErrorDefinition,\n SchemaMap,\n AnySchema,\n} from \"../../types\"\nimport type {KeywordCxt} from \"../../compile/validate\"\nimport {_, str} from \"../../compile/codegen\"\nimport {alwaysValidSchema} from \"../../compile/util\"\nimport {checkReportMissingProp, checkMissingProp, reportMissingProp, propertyInData} from \"../code\"\n\nexport type PropertyDependencies = {[K in string]?: string[]}\n\nexport interface DependenciesErrorParams {\n property: string\n missingProperty: string\n depsCount: number\n deps: string // TODO change to string[]\n}\n\ntype SchemaDependencies = SchemaMap\n\nexport type DependenciesError = ErrorObject<\n \"dependencies\",\n DependenciesErrorParams,\n {[K in string]?: string[] | AnySchema}\n>\n\nexport const error: KeywordErrorDefinition = {\n message: ({params: {property, depsCount, deps}}) => {\n const property_ies = depsCount === 1 ? \"property\" : \"properties\"\n return str`must have ${property_ies} ${deps} when property ${property} is present`\n },\n params: ({params: {property, depsCount, deps, missingProperty}}) =>\n _`{property: ${property},\n missingProperty: ${missingProperty},\n depsCount: ${depsCount},\n deps: ${deps}}`, // TODO change to reference\n}\n\nconst def: CodeKeywordDefinition = {\n keyword: \"dependencies\",\n type: \"object\",\n schemaType: \"object\",\n error,\n code(cxt: KeywordCxt) {\n const [propDeps, schDeps] = splitDependencies(cxt)\n validatePropertyDeps(cxt, propDeps)\n validateSchemaDeps(cxt, schDeps)\n },\n}\n\nfunction splitDependencies({schema}: KeywordCxt): [PropertyDependencies, SchemaDependencies] {\n const propertyDeps: PropertyDependencies = {}\n const schemaDeps: SchemaDependencies = {}\n for (const key in schema) {\n if (key === \"__proto__\") continue\n const deps = Array.isArray(schema[key]) ? propertyDeps : schemaDeps\n deps[key] = schema[key]\n }\n return [propertyDeps, schemaDeps]\n}\n\nexport function validatePropertyDeps(\n cxt: KeywordCxt,\n propertyDeps: {[K in string]?: string[]} = cxt.schema\n): void {\n const {gen, data, it} = cxt\n if (Object.keys(propertyDeps).length === 0) return\n const missing = gen.let(\"missing\")\n for (const prop in propertyDeps) {\n const deps = propertyDeps[prop] as string[]\n if (deps.length === 0) continue\n const hasProperty = propertyInData(gen, data, prop, it.opts.ownProperties)\n cxt.setParams({\n property: prop,\n depsCount: deps.length,\n deps: deps.join(\", \"),\n })\n if (it.allErrors) {\n gen.if(hasProperty, () => {\n for (const depProp of deps) {\n checkReportMissingProp(cxt, depProp)\n }\n })\n } else {\n gen.if(_`${hasProperty} && (${checkMissingProp(cxt, deps, missing)})`)\n reportMissingProp(cxt, missing)\n gen.else()\n }\n }\n}\n\nexport function validateSchemaDeps(cxt: KeywordCxt, schemaDeps: SchemaMap = cxt.schema): void {\n const {gen, data, keyword, it} = cxt\n const valid = gen.name(\"valid\")\n for (const prop in schemaDeps) {\n if (alwaysValidSchema(it, schemaDeps[prop] as AnySchema)) continue\n gen.if(\n propertyInData(gen, data, prop, it.opts.ownProperties),\n () => {\n const schCxt = cxt.subschema({keyword, schemaProp: prop}, valid)\n cxt.mergeValidEvaluated(schCxt, valid)\n },\n () => gen.var(valid, true) // TODO var\n )\n cxt.ok(valid)\n }\n}\n\nexport default def\n", "import type {\n CodeKeywordDefinition,\n ErrorObject,\n KeywordErrorDefinition,\n AnySchema,\n} from \"../../types\"\nimport type {KeywordCxt} from \"../../compile/validate\"\nimport {_, not} from \"../../compile/codegen\"\nimport {alwaysValidSchema} from \"../../compile/util\"\n\nexport type PropertyNamesError = ErrorObject<\"propertyNames\", {propertyName: string}, AnySchema>\n\nconst error: KeywordErrorDefinition = {\n message: \"property name must be valid\",\n params: ({params}) => _`{propertyName: ${params.propertyName}}`,\n}\n\nconst def: CodeKeywordDefinition = {\n keyword: \"propertyNames\",\n type: \"object\",\n schemaType: [\"object\", \"boolean\"],\n error,\n code(cxt: KeywordCxt) {\n const {gen, schema, data, it} = cxt\n if (alwaysValidSchema(it, schema)) return\n const valid = gen.name(\"valid\")\n\n gen.forIn(\"key\", data, (key) => {\n cxt.setParams({propertyName: key})\n cxt.subschema(\n {\n keyword: \"propertyNames\",\n data: key,\n dataTypes: [\"string\"],\n propertyName: key,\n compositeRule: true,\n },\n valid\n )\n gen.if(not(valid), () => {\n cxt.error(true)\n if (!it.allErrors) gen.break()\n })\n })\n\n cxt.ok(valid)\n },\n}\n\nexport default def\n", "import type {\n CodeKeywordDefinition,\n AddedKeywordDefinition,\n ErrorObject,\n KeywordErrorDefinition,\n AnySchema,\n} from \"../../types\"\nimport {allSchemaProperties, usePattern, isOwnProperty} from \"../code\"\nimport {_, nil, or, not, Code, Name} from \"../../compile/codegen\"\nimport N from \"../../compile/names\"\nimport type {SubschemaArgs} from \"../../compile/validate/subschema\"\nimport {alwaysValidSchema, schemaRefOrVal, Type} from \"../../compile/util\"\n\nexport type AdditionalPropertiesError = ErrorObject<\n \"additionalProperties\",\n {additionalProperty: string},\n AnySchema\n>\n\nconst error: KeywordErrorDefinition = {\n message: \"must NOT have additional properties\",\n params: ({params}) => _`{additionalProperty: ${params.additionalProperty}}`,\n}\n\nconst def: CodeKeywordDefinition & AddedKeywordDefinition = {\n keyword: \"additionalProperties\",\n type: [\"object\"],\n schemaType: [\"boolean\", \"object\"],\n allowUndefined: true,\n trackErrors: true,\n error,\n code(cxt) {\n const {gen, schema, parentSchema, data, errsCount, it} = cxt\n /* istanbul ignore if */\n if (!errsCount) throw new Error(\"ajv implementation error\")\n const {allErrors, opts} = it\n it.props = true\n if (opts.removeAdditional !== \"all\" && alwaysValidSchema(it, schema)) return\n const props = allSchemaProperties(parentSchema.properties)\n const patProps = allSchemaProperties(parentSchema.patternProperties)\n checkAdditionalProperties()\n cxt.ok(_`${errsCount} === ${N.errors}`)\n\n function checkAdditionalProperties(): void {\n gen.forIn(\"key\", data, (key: Name) => {\n if (!props.length && !patProps.length) additionalPropertyCode(key)\n else gen.if(isAdditional(key), () => additionalPropertyCode(key))\n })\n }\n\n function isAdditional(key: Name): Code {\n let definedProp: Code\n if (props.length > 8) {\n // TODO maybe an option instead of hard-coded 8?\n const propsSchema = schemaRefOrVal(it, parentSchema.properties, \"properties\")\n definedProp = isOwnProperty(gen, propsSchema as Code, key)\n } else if (props.length) {\n definedProp = or(...props.map((p) => _`${key} === ${p}`))\n } else {\n definedProp = nil\n }\n if (patProps.length) {\n definedProp = or(definedProp, ...patProps.map((p) => _`${usePattern(cxt, p)}.test(${key})`))\n }\n return not(definedProp)\n }\n\n function deleteAdditional(key: Name): void {\n gen.code(_`delete ${data}[${key}]`)\n }\n\n function additionalPropertyCode(key: Name): void {\n if (opts.removeAdditional === \"all\" || (opts.removeAdditional && schema === false)) {\n deleteAdditional(key)\n return\n }\n\n if (schema === false) {\n cxt.setParams({additionalProperty: key})\n cxt.error()\n if (!allErrors) gen.break()\n return\n }\n\n if (typeof schema == \"object\" && !alwaysValidSchema(it, schema)) {\n const valid = gen.name(\"valid\")\n if (opts.removeAdditional === \"failing\") {\n applyAdditionalSchema(key, valid, false)\n gen.if(not(valid), () => {\n cxt.reset()\n deleteAdditional(key)\n })\n } else {\n applyAdditionalSchema(key, valid)\n if (!allErrors) gen.if(not(valid), () => gen.break())\n }\n }\n }\n\n function applyAdditionalSchema(key: Name, valid: Name, errors?: false): void {\n const subschema: SubschemaArgs = {\n keyword: \"additionalProperties\",\n dataProp: key,\n dataPropType: Type.Str,\n }\n if (errors === false) {\n Object.assign(subschema, {\n compositeRule: true,\n createErrors: false,\n allErrors: false,\n })\n }\n cxt.subschema(subschema, valid)\n }\n },\n}\n\nexport default def\n", "import type {CodeKeywordDefinition} from \"../../types\"\nimport {KeywordCxt} from \"../../compile/validate\"\nimport {propertyInData, allSchemaProperties} from \"../code\"\nimport {alwaysValidSchema, toHash, mergeEvaluated} from \"../../compile/util\"\nimport apDef from \"./additionalProperties\"\n\nconst def: CodeKeywordDefinition = {\n keyword: \"properties\",\n type: \"object\",\n schemaType: \"object\",\n code(cxt: KeywordCxt) {\n const {gen, schema, parentSchema, data, it} = cxt\n if (it.opts.removeAdditional === \"all\" && parentSchema.additionalProperties === undefined) {\n apDef.code(new KeywordCxt(it, apDef, \"additionalProperties\"))\n }\n const allProps = allSchemaProperties(schema)\n for (const prop of allProps) {\n it.definedProperties.add(prop)\n }\n if (it.opts.unevaluated && allProps.length && it.props !== true) {\n it.props = mergeEvaluated.props(gen, toHash(allProps), it.props)\n }\n const properties = allProps.filter((p) => !alwaysValidSchema(it, schema[p]))\n if (properties.length === 0) return\n const valid = gen.name(\"valid\")\n\n for (const prop of properties) {\n if (hasDefault(prop)) {\n applyPropertySchema(prop)\n } else {\n gen.if(propertyInData(gen, data, prop, it.opts.ownProperties))\n applyPropertySchema(prop)\n if (!it.allErrors) gen.else().var(valid, true)\n gen.endIf()\n }\n cxt.it.definedProperties.add(prop)\n cxt.ok(valid)\n }\n\n function hasDefault(prop: string): boolean | undefined {\n return it.opts.useDefaults && !it.compositeRule && schema[prop].default !== undefined\n }\n\n function applyPropertySchema(prop: string): void {\n cxt.subschema(\n {\n keyword: \"properties\",\n schemaProp: prop,\n dataProp: prop,\n },\n valid\n )\n }\n },\n}\n\nexport default def\n", "import type {CodeKeywordDefinition} from \"../../types\"\nimport type {KeywordCxt} from \"../../compile/validate\"\nimport {allSchemaProperties, usePattern} from \"../code\"\nimport {_, not, Name} from \"../../compile/codegen\"\nimport {alwaysValidSchema, checkStrictMode} from \"../../compile/util\"\nimport {evaluatedPropsToName, Type} from \"../../compile/util\"\nimport {AnySchema} from \"../../types\"\n\nconst def: CodeKeywordDefinition = {\n keyword: \"patternProperties\",\n type: \"object\",\n schemaType: \"object\",\n code(cxt: KeywordCxt) {\n const {gen, schema, data, parentSchema, it} = cxt\n const {opts} = it\n const patterns = allSchemaProperties(schema)\n const alwaysValidPatterns = patterns.filter((p) =>\n alwaysValidSchema(it, schema[p] as AnySchema)\n )\n\n if (\n patterns.length === 0 ||\n (alwaysValidPatterns.length === patterns.length &&\n (!it.opts.unevaluated || it.props === true))\n ) {\n return\n }\n\n const checkProperties =\n opts.strictSchema && !opts.allowMatchingProperties && parentSchema.properties\n const valid = gen.name(\"valid\")\n if (it.props !== true && !(it.props instanceof Name)) {\n it.props = evaluatedPropsToName(gen, it.props)\n }\n const {props} = it\n validatePatternProperties()\n\n function validatePatternProperties(): void {\n for (const pat of patterns) {\n if (checkProperties) checkMatchingProperties(pat)\n if (it.allErrors) {\n validateProperties(pat)\n } else {\n gen.var(valid, true) // TODO var\n validateProperties(pat)\n gen.if(valid)\n }\n }\n }\n\n function checkMatchingProperties(pat: string): void {\n for (const prop in checkProperties) {\n if (new RegExp(pat).test(prop)) {\n checkStrictMode(\n it,\n `property ${prop} matches pattern ${pat} (use allowMatchingProperties)`\n )\n }\n }\n }\n\n function validateProperties(pat: string): void {\n gen.forIn(\"key\", data, (key) => {\n gen.if(_`${usePattern(cxt, pat)}.test(${key})`, () => {\n const alwaysValid = alwaysValidPatterns.includes(pat)\n if (!alwaysValid) {\n cxt.subschema(\n {\n keyword: \"patternProperties\",\n schemaProp: pat,\n dataProp: key,\n dataPropType: Type.Str,\n },\n valid\n )\n }\n\n if (it.opts.unevaluated && props !== true) {\n gen.assign(_`${props}[${key}]`, true)\n } else if (!alwaysValid && !it.allErrors) {\n // can short-circuit if `unevaluatedProperties` is not supported (opts.next === false)\n // or if all properties were evaluated (props === true)\n gen.if(not(valid), () => gen.break())\n }\n })\n })\n }\n },\n}\n\nexport default def\n", "import type {CodeKeywordDefinition, ErrorNoParams, AnySchema} from \"../../types\"\nimport type {KeywordCxt} from \"../../compile/validate\"\nimport {alwaysValidSchema} from \"../../compile/util\"\n\nexport type NotKeywordError = ErrorNoParams<\"not\", AnySchema>\n\nconst def: CodeKeywordDefinition = {\n keyword: \"not\",\n schemaType: [\"object\", \"boolean\"],\n trackErrors: true,\n code(cxt: KeywordCxt) {\n const {gen, schema, it} = cxt\n if (alwaysValidSchema(it, schema)) {\n cxt.fail()\n return\n }\n\n const valid = gen.name(\"valid\")\n cxt.subschema(\n {\n keyword: \"not\",\n compositeRule: true,\n createErrors: false,\n allErrors: false,\n },\n valid\n )\n\n cxt.failResult(\n valid,\n () => cxt.reset(),\n () => cxt.error()\n )\n },\n error: {message: \"must NOT be valid\"},\n}\n\nexport default def\n", "import type {CodeKeywordDefinition, ErrorNoParams, AnySchema} from \"../../types\"\nimport {validateUnion} from \"../code\"\n\nexport type AnyOfError = ErrorNoParams<\"anyOf\", AnySchema[]>\n\nconst def: CodeKeywordDefinition = {\n keyword: \"anyOf\",\n schemaType: \"array\",\n trackErrors: true,\n code: validateUnion,\n error: {message: \"must match a schema in anyOf\"},\n}\n\nexport default def\n", "import type {\n CodeKeywordDefinition,\n ErrorObject,\n KeywordErrorDefinition,\n AnySchema,\n} from \"../../types\"\nimport type {KeywordCxt} from \"../../compile/validate\"\nimport {_, Name} from \"../../compile/codegen\"\nimport {alwaysValidSchema} from \"../../compile/util\"\nimport {SchemaCxt} from \"../../compile\"\n\nexport type OneOfError = ErrorObject<\n \"oneOf\",\n {passingSchemas: [number, number] | null},\n AnySchema[]\n>\n\nconst error: KeywordErrorDefinition = {\n message: \"must match exactly one schema in oneOf\",\n params: ({params}) => _`{passingSchemas: ${params.passing}}`,\n}\n\nconst def: CodeKeywordDefinition = {\n keyword: \"oneOf\",\n schemaType: \"array\",\n trackErrors: true,\n error,\n code(cxt: KeywordCxt) {\n const {gen, schema, parentSchema, it} = cxt\n /* istanbul ignore if */\n if (!Array.isArray(schema)) throw new Error(\"ajv implementation error\")\n if (it.opts.discriminator && parentSchema.discriminator) return\n const schArr: AnySchema[] = schema\n const valid = gen.let(\"valid\", false)\n const passing = gen.let(\"passing\", null)\n const schValid = gen.name(\"_valid\")\n cxt.setParams({passing})\n // TODO possibly fail straight away (with warning or exception) if there are two empty always valid schemas\n\n gen.block(validateOneOf)\n\n cxt.result(\n valid,\n () => cxt.reset(),\n () => cxt.error(true)\n )\n\n function validateOneOf(): void {\n schArr.forEach((sch: AnySchema, i: number) => {\n let schCxt: SchemaCxt | undefined\n if (alwaysValidSchema(it, sch)) {\n gen.var(schValid, true)\n } else {\n schCxt = cxt.subschema(\n {\n keyword: \"oneOf\",\n schemaProp: i,\n compositeRule: true,\n },\n schValid\n )\n }\n\n if (i > 0) {\n gen\n .if(_`${schValid} && ${valid}`)\n .assign(valid, false)\n .assign(passing, _`[${passing}, ${i}]`)\n .else()\n }\n\n gen.if(schValid, () => {\n gen.assign(valid, true)\n gen.assign(passing, i)\n if (schCxt) cxt.mergeEvaluated(schCxt, Name)\n })\n })\n }\n },\n}\n\nexport default def\n", "import type {CodeKeywordDefinition, AnySchema} from \"../../types\"\nimport type {KeywordCxt} from \"../../compile/validate\"\nimport {alwaysValidSchema} from \"../../compile/util\"\n\nconst def: CodeKeywordDefinition = {\n keyword: \"allOf\",\n schemaType: \"array\",\n code(cxt: KeywordCxt) {\n const {gen, schema, it} = cxt\n /* istanbul ignore if */\n if (!Array.isArray(schema)) throw new Error(\"ajv implementation error\")\n const valid = gen.name(\"valid\")\n schema.forEach((sch: AnySchema, i: number) => {\n if (alwaysValidSchema(it, sch)) return\n const schCxt = cxt.subschema({keyword: \"allOf\", schemaProp: i}, valid)\n cxt.ok(valid)\n cxt.mergeEvaluated(schCxt)\n })\n },\n}\n\nexport default def\n", "import type {\n CodeKeywordDefinition,\n ErrorObject,\n KeywordErrorDefinition,\n AnySchema,\n} from \"../../types\"\nimport type {SchemaObjCxt} from \"../../compile\"\nimport type {KeywordCxt} from \"../../compile/validate\"\nimport {_, str, not, Name} from \"../../compile/codegen\"\nimport {alwaysValidSchema, checkStrictMode} from \"../../compile/util\"\n\nexport type IfKeywordError = ErrorObject<\"if\", {failingKeyword: string}, AnySchema>\n\nconst error: KeywordErrorDefinition = {\n message: ({params}) => str`must match \"${params.ifClause}\" schema`,\n params: ({params}) => _`{failingKeyword: ${params.ifClause}}`,\n}\n\nconst def: CodeKeywordDefinition = {\n keyword: \"if\",\n schemaType: [\"object\", \"boolean\"],\n trackErrors: true,\n error,\n code(cxt: KeywordCxt) {\n const {gen, parentSchema, it} = cxt\n if (parentSchema.then === undefined && parentSchema.else === undefined) {\n checkStrictMode(it, '\"if\" without \"then\" and \"else\" is ignored')\n }\n const hasThen = hasSchema(it, \"then\")\n const hasElse = hasSchema(it, \"else\")\n if (!hasThen && !hasElse) return\n\n const valid = gen.let(\"valid\", true)\n const schValid = gen.name(\"_valid\")\n validateIf()\n cxt.reset()\n\n if (hasThen && hasElse) {\n const ifClause = gen.let(\"ifClause\")\n cxt.setParams({ifClause})\n gen.if(schValid, validateClause(\"then\", ifClause), validateClause(\"else\", ifClause))\n } else if (hasThen) {\n gen.if(schValid, validateClause(\"then\"))\n } else {\n gen.if(not(schValid), validateClause(\"else\"))\n }\n\n cxt.pass(valid, () => cxt.error(true))\n\n function validateIf(): void {\n const schCxt = cxt.subschema(\n {\n keyword: \"if\",\n compositeRule: true,\n createErrors: false,\n allErrors: false,\n },\n schValid\n )\n cxt.mergeEvaluated(schCxt)\n }\n\n function validateClause(keyword: string, ifClause?: Name): () => void {\n return () => {\n const schCxt = cxt.subschema({keyword}, schValid)\n gen.assign(valid, schValid)\n cxt.mergeValidEvaluated(schCxt, valid)\n if (ifClause) gen.assign(ifClause, _`${keyword}`)\n else cxt.setParams({ifClause: keyword})\n }\n }\n },\n}\n\nfunction hasSchema(it: SchemaObjCxt, keyword: string): boolean {\n const schema = it.schema[keyword]\n return schema !== undefined && !alwaysValidSchema(it, schema)\n}\n\nexport default def\n", "import type {CodeKeywordDefinition} from \"../../types\"\nimport type {KeywordCxt} from \"../../compile/validate\"\nimport {checkStrictMode} from \"../../compile/util\"\n\nconst def: CodeKeywordDefinition = {\n keyword: [\"then\", \"else\"],\n schemaType: [\"object\", \"boolean\"],\n code({keyword, parentSchema, it}: KeywordCxt) {\n if (parentSchema.if === undefined) checkStrictMode(it, `\"${keyword}\" without \"if\" is ignored`)\n },\n}\n\nexport default def\n", "import type {ErrorNoParams, Vocabulary} from \"../../types\"\nimport additionalItems, {AdditionalItemsError} from \"./additionalItems\"\nimport prefixItems from \"./prefixItems\"\nimport items from \"./items\"\nimport items2020, {ItemsError} from \"./items2020\"\nimport contains, {ContainsError} from \"./contains\"\nimport dependencies, {DependenciesError} from \"./dependencies\"\nimport propertyNames, {PropertyNamesError} from \"./propertyNames\"\nimport additionalProperties, {AdditionalPropertiesError} from \"./additionalProperties\"\nimport properties from \"./properties\"\nimport patternProperties from \"./patternProperties\"\nimport notKeyword, {NotKeywordError} from \"./not\"\nimport anyOf, {AnyOfError} from \"./anyOf\"\nimport oneOf, {OneOfError} from \"./oneOf\"\nimport allOf from \"./allOf\"\nimport ifKeyword, {IfKeywordError} from \"./if\"\nimport thenElse from \"./thenElse\"\n\nexport default function getApplicator(draft2020 = false): Vocabulary {\n const applicator = [\n // any\n notKeyword,\n anyOf,\n oneOf,\n allOf,\n ifKeyword,\n thenElse,\n // object\n propertyNames,\n additionalProperties,\n dependencies,\n properties,\n patternProperties,\n ]\n // array\n if (draft2020) applicator.push(prefixItems, items2020)\n else applicator.push(additionalItems, items)\n applicator.push(contains)\n return applicator\n}\n\nexport type ApplicatorKeywordError =\n | ErrorNoParams<\"false schema\">\n | AdditionalItemsError\n | ItemsError\n | ContainsError\n | AdditionalPropertiesError\n | DependenciesError\n | IfKeywordError\n | AnyOfError\n | OneOfError\n | NotKeywordError\n | PropertyNamesError\n", "import type {\n AddedFormat,\n FormatValidator,\n AsyncFormatValidator,\n CodeKeywordDefinition,\n KeywordErrorDefinition,\n ErrorObject,\n} from \"../../types\"\nimport type {KeywordCxt} from \"../../compile/validate\"\nimport {_, str, nil, or, Code, getProperty, regexpCode} from \"../../compile/codegen\"\n\ntype FormatValidate =\n | FormatValidator<string>\n | FormatValidator<number>\n | AsyncFormatValidator<string>\n | AsyncFormatValidator<number>\n | RegExp\n | string\n | true\n\nexport type FormatError = ErrorObject<\"format\", {format: string}, string | {$data: string}>\n\nconst error: KeywordErrorDefinition = {\n message: ({schemaCode}) => str`must match format \"${schemaCode}\"`,\n params: ({schemaCode}) => _`{format: ${schemaCode}}`,\n}\n\nconst def: CodeKeywordDefinition = {\n keyword: \"format\",\n type: [\"number\", \"string\"],\n schemaType: \"string\",\n $data: true,\n error,\n code(cxt: KeywordCxt, ruleType?: string) {\n const {gen, data, $data, schema, schemaCode, it} = cxt\n const {opts, errSchemaPath, schemaEnv, self} = it\n if (!opts.validateFormats) return\n\n if ($data) validate$DataFormat()\n else validateFormat()\n\n function validate$DataFormat(): void {\n const fmts = gen.scopeValue(\"formats\", {\n ref: self.formats,\n code: opts.code.formats,\n })\n const fDef = gen.const(\"fDef\", _`${fmts}[${schemaCode}]`)\n const fType = gen.let(\"fType\")\n const format = gen.let(\"format\")\n // TODO simplify\n gen.if(\n _`typeof ${fDef} == \"object\" && !(${fDef} instanceof RegExp)`,\n () => gen.assign(fType, _`${fDef}.type || \"string\"`).assign(format, _`${fDef}.validate`),\n () => gen.assign(fType, _`\"string\"`).assign(format, fDef)\n )\n cxt.fail$data(or(unknownFmt(), invalidFmt()))\n\n function unknownFmt(): Code {\n if (opts.strictSchema === false) return nil\n return _`${schemaCode} && !${format}`\n }\n\n function invalidFmt(): Code {\n const callFormat = schemaEnv.$async\n ? _`(${fDef}.async ? await ${format}(${data}) : ${format}(${data}))`\n : _`${format}(${data})`\n const validData = _`(typeof ${format} == \"function\" ? ${callFormat} : ${format}.test(${data}))`\n return _`${format} && ${format} !== true && ${fType} === ${ruleType} && !${validData}`\n }\n }\n\n function validateFormat(): void {\n const formatDef: AddedFormat | undefined = self.formats[schema]\n if (!formatDef) {\n unknownFormat()\n return\n }\n if (formatDef === true) return\n const [fmtType, format, fmtRef] = getFormat(formatDef)\n if (fmtType === ruleType) cxt.pass(validCondition())\n\n function unknownFormat(): void {\n if (opts.strictSchema === false) {\n self.logger.warn(unknownMsg())\n return\n }\n throw new Error(unknownMsg())\n\n function unknownMsg(): string {\n return `unknown format \"${schema as string}\" ignored in schema at path \"${errSchemaPath}\"`\n }\n }\n\n function getFormat(fmtDef: AddedFormat): [string, FormatValidate, Code] {\n const code =\n fmtDef instanceof RegExp\n ? regexpCode(fmtDef)\n : opts.code.formats\n ? _`${opts.code.formats}${getProperty(schema)}`\n : undefined\n const fmt = gen.scopeValue(\"formats\", {key: schema, ref: fmtDef, code})\n if (typeof fmtDef == \"object\" && !(fmtDef instanceof RegExp)) {\n return [fmtDef.type || \"string\", fmtDef.validate, _`${fmt}.validate`]\n }\n\n return [\"string\", fmtDef, fmt]\n }\n\n function validCondition(): Code {\n if (typeof formatDef == \"object\" && !(formatDef instanceof RegExp) && formatDef.async) {\n if (!schemaEnv.$async) throw new Error(\"async format in sync schema\")\n return _`await ${fmtRef}(${data})`\n }\n return typeof format == \"function\" ? _`${fmtRef}(${data})` : _`${fmtRef}.test(${data})`\n }\n }\n },\n}\n\nexport default def\n", "import type {Vocabulary} from \"../../types\"\nimport formatKeyword from \"./format\"\n\nconst format: Vocabulary = [formatKeyword]\n\nexport default format\n", "import type {Vocabulary} from \"../types\"\n\nexport const metadataVocabulary: Vocabulary = [\n \"title\",\n \"description\",\n \"default\",\n \"deprecated\",\n \"readOnly\",\n \"writeOnly\",\n \"examples\",\n]\n\nexport const contentVocabulary: Vocabulary = [\n \"contentMediaType\",\n \"contentEncoding\",\n \"contentSchema\",\n]\n", "import type {Vocabulary} from \"../types\"\nimport coreVocabulary from \"./core\"\nimport validationVocabulary from \"./validation\"\nimport getApplicatorVocabulary from \"./applicator\"\nimport formatVocabulary from \"./format\"\nimport {metadataVocabulary, contentVocabulary} from \"./metadata\"\n\nconst draft7Vocabularies: Vocabulary[] = [\n coreVocabulary,\n validationVocabulary,\n getApplicatorVocabulary(),\n formatVocabulary,\n metadataVocabulary,\n contentVocabulary,\n]\n\nexport default draft7Vocabularies\n", "import type {ErrorObject} from \"../../types\"\n\nexport enum DiscrError {\n Tag = \"tag\",\n Mapping = \"mapping\",\n}\n\nexport type DiscrErrorObj<E extends DiscrError> = ErrorObject<\n \"discriminator\",\n {error: E; tag: string; tagValue: unknown},\n string\n>\n", "import type {CodeKeywordDefinition, AnySchemaObject, KeywordErrorDefinition} from \"../../types\"\nimport type {KeywordCxt} from \"../../compile/validate\"\nimport {_, getProperty, Name} from \"../../compile/codegen\"\nimport {DiscrError, DiscrErrorObj} from \"../discriminator/types\"\nimport {resolveRef, SchemaEnv} from \"../../compile\"\nimport MissingRefError from \"../../compile/ref_error\"\nimport {schemaHasRulesButRef} from \"../../compile/util\"\n\nexport type DiscriminatorError = DiscrErrorObj<DiscrError.Tag> | DiscrErrorObj<DiscrError.Mapping>\n\nconst error: KeywordErrorDefinition = {\n message: ({params: {discrError, tagName}}) =>\n discrError === DiscrError.Tag\n ? `tag \"${tagName}\" must be string`\n : `value of tag \"${tagName}\" must be in oneOf`,\n params: ({params: {discrError, tag, tagName}}) =>\n _`{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}`,\n}\n\nconst def: CodeKeywordDefinition = {\n keyword: \"discriminator\",\n type: \"object\",\n schemaType: \"object\",\n error,\n code(cxt: KeywordCxt) {\n const {gen, data, schema, parentSchema, it} = cxt\n const {oneOf} = parentSchema\n if (!it.opts.discriminator) {\n throw new Error(\"discriminator: requires discriminator option\")\n }\n const tagName = schema.propertyName\n if (typeof tagName != \"string\") throw new Error(\"discriminator: requires propertyName\")\n if (schema.mapping) throw new Error(\"discriminator: mapping is not supported\")\n if (!oneOf) throw new Error(\"discriminator: requires oneOf keyword\")\n const valid = gen.let(\"valid\", false)\n const tag = gen.const(\"tag\", _`${data}${getProperty(tagName)}`)\n gen.if(\n _`typeof ${tag} == \"string\"`,\n () => validateMapping(),\n () => cxt.error(false, {discrError: DiscrError.Tag, tag, tagName})\n )\n cxt.ok(valid)\n\n function validateMapping(): void {\n const mapping = getMapping()\n gen.if(false)\n for (const tagValue in mapping) {\n gen.elseIf(_`${tag} === ${tagValue}`)\n gen.assign(valid, applyTagSchema(mapping[tagValue]))\n }\n gen.else()\n cxt.error(false, {discrError: DiscrError.Mapping, tag, tagName})\n gen.endIf()\n }\n\n function applyTagSchema(schemaProp?: number): Name {\n const _valid = gen.name(\"valid\")\n const schCxt = cxt.subschema({keyword: \"oneOf\", schemaProp}, _valid)\n cxt.mergeEvaluated(schCxt, Name)\n return _valid\n }\n\n function getMapping(): {[T in string]?: number} {\n const oneOfMapping: {[T in string]?: number} = {}\n const topRequired = hasRequired(parentSchema)\n let tagRequired = true\n for (let i = 0; i < oneOf.length; i++) {\n let sch = oneOf[i]\n if (sch?.$ref && !schemaHasRulesButRef(sch, it.self.RULES)) {\n const ref = sch.$ref\n sch = resolveRef.call(it.self, it.schemaEnv.root, it.baseId, ref)\n if (sch instanceof SchemaEnv) sch = sch.schema\n if (sch === undefined) throw new MissingRefError(it.opts.uriResolver, it.baseId, ref)\n }\n const propSch = sch?.properties?.[tagName]\n if (typeof propSch != \"object\") {\n throw new Error(\n `discriminator: oneOf subschemas (or referenced schemas) must have \"properties/${tagName}\"`\n )\n }\n tagRequired = tagRequired && (topRequired || hasRequired(sch))\n addMappings(propSch, i)\n }\n if (!tagRequired) throw new Error(`discriminator: \"${tagName}\" must be required`)\n return oneOfMapping\n\n function hasRequired({required}: AnySchemaObject): boolean {\n return Array.isArray(required) && required.includes(tagName)\n }\n\n function addMappings(sch: AnySchemaObject, i: number): void {\n if (sch.const) {\n addMapping(sch.const, i)\n } else if (sch.enum) {\n for (const tagValue of sch.enum) {\n addMapping(tagValue, i)\n }\n } else {\n throw new Error(`discriminator: \"properties/${tagName}\" must have \"const\" or \"enum\"`)\n }\n }\n\n function addMapping(tagValue: unknown, i: number): void {\n if (typeof tagValue != \"string\" || tagValue in oneOfMapping) {\n throw new Error(`discriminator: \"${tagName}\" values must be unique strings`)\n }\n oneOfMapping[tagValue] = i\n }\n }\n },\n}\n\nexport default def\n", "{\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"http://json-schema.org/draft-07/schema#\",\n \"title\": \"Core schema meta-schema\",\n \"definitions\": {\n \"schemaArray\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": {\"$ref\": \"#\"}\n },\n \"nonNegativeInteger\": {\n \"type\": \"integer\",\n \"minimum\": 0\n },\n \"nonNegativeIntegerDefault0\": {\n \"allOf\": [{\"$ref\": \"#/definitions/nonNegativeInteger\"}, {\"default\": 0}]\n },\n \"simpleTypes\": {\n \"enum\": [\"array\", \"boolean\", \"integer\", \"null\", \"number\", \"object\", \"string\"]\n },\n \"stringArray\": {\n \"type\": \"array\",\n \"items\": {\"type\": \"string\"},\n \"uniqueItems\": true,\n \"default\": []\n }\n },\n \"type\": [\"object\", \"boolean\"],\n \"properties\": {\n \"$id\": {\n \"type\": \"string\",\n \"format\": \"uri-reference\"\n },\n \"$schema\": {\n \"type\": \"string\",\n \"format\": \"uri\"\n },\n \"$ref\": {\n \"type\": \"string\",\n \"format\": \"uri-reference\"\n },\n \"$comment\": {\n \"type\": \"string\"\n },\n \"title\": {\n \"type\": \"string\"\n },\n \"description\": {\n \"type\": \"string\"\n },\n \"default\": true,\n \"readOnly\": {\n \"type\": \"boolean\",\n \"default\": false\n },\n \"examples\": {\n \"type\": \"array\",\n \"items\": true\n },\n \"multipleOf\": {\n \"type\": \"number\",\n \"exclusiveMinimum\": 0\n },\n \"maximum\": {\n \"type\": \"number\"\n },\n \"exclusiveMaximum\": {\n \"type\": \"number\"\n },\n \"minimum\": {\n \"type\": \"number\"\n },\n \"exclusiveMinimum\": {\n \"type\": \"number\"\n },\n \"maxLength\": {\"$ref\": \"#/definitions/nonNegativeInteger\"},\n \"minLength\": {\"$ref\": \"#/definitions/nonNegativeIntegerDefault0\"},\n \"pattern\": {\n \"type\": \"string\",\n \"format\": \"regex\"\n },\n \"additionalItems\": {\"$ref\": \"#\"},\n \"items\": {\n \"anyOf\": [{\"$ref\": \"#\"}, {\"$ref\": \"#/definitions/schemaArray\"}],\n \"default\": true\n },\n \"maxItems\": {\"$ref\": \"#/definitions/nonNegativeInteger\"},\n \"minItems\": {\"$ref\": \"#/definitions/nonNegativeIntegerDefault0\"},\n \"uniqueItems\": {\n \"type\": \"boolean\",\n \"default\": false\n },\n \"contains\": {\"$ref\": \"#\"},\n \"maxProperties\": {\"$ref\": \"#/definitions/nonNegativeInteger\"},\n \"minProperties\": {\"$ref\": \"#/definitions/nonNegativeIntegerDefault0\"},\n \"required\": {\"$ref\": \"#/definitions/stringArray\"},\n \"additionalProperties\": {\"$ref\": \"#\"},\n \"definitions\": {\n \"type\": \"object\",\n \"additionalProperties\": {\"$ref\": \"#\"},\n \"default\": {}\n },\n \"properties\": {\n \"type\": \"object\",\n \"additionalProperties\": {\"$ref\": \"#\"},\n \"default\": {}\n },\n \"patternProperties\": {\n \"type\": \"object\",\n \"additionalProperties\": {\"$ref\": \"#\"},\n \"propertyNames\": {\"format\": \"regex\"},\n \"default\": {}\n },\n \"dependencies\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"anyOf\": [{\"$ref\": \"#\"}, {\"$ref\": \"#/definitions/stringArray\"}]\n }\n },\n \"propertyNames\": {\"$ref\": \"#\"},\n \"const\": true,\n \"enum\": {\n \"type\": \"array\",\n \"items\": true,\n \"minItems\": 1,\n \"uniqueItems\": true\n },\n \"type\": {\n \"anyOf\": [\n {\"$ref\": \"#/definitions/simpleTypes\"},\n {\n \"type\": \"array\",\n \"items\": {\"$ref\": \"#/definitions/simpleTypes\"},\n \"minItems\": 1,\n \"uniqueItems\": true\n }\n ]\n },\n \"format\": {\"type\": \"string\"},\n \"contentMediaType\": {\"type\": \"string\"},\n \"contentEncoding\": {\"type\": \"string\"},\n \"if\": {\"$ref\": \"#\"},\n \"then\": {\"$ref\": \"#\"},\n \"else\": {\"$ref\": \"#\"},\n \"allOf\": {\"$ref\": \"#/definitions/schemaArray\"},\n \"anyOf\": {\"$ref\": \"#/definitions/schemaArray\"},\n \"oneOf\": {\"$ref\": \"#/definitions/schemaArray\"},\n \"not\": {\"$ref\": \"#\"}\n },\n \"default\": true\n}\n", "import type {AnySchemaObject} from \"./types\"\nimport AjvCore from \"./core\"\nimport draft7Vocabularies from \"./vocabularies/draft7\"\nimport discriminator from \"./vocabularies/discriminator\"\nimport * as draft7MetaSchema from \"./refs/json-schema-draft-07.json\"\n\nconst META_SUPPORT_DATA = [\"/properties\"]\n\nconst META_SCHEMA_ID = \"http://json-schema.org/draft-07/schema\"\n\nexport class Ajv extends AjvCore {\n _addVocabularies(): void {\n super._addVocabularies()\n draft7Vocabularies.forEach((v) => this.addVocabulary(v))\n if (this.opts.discriminator) this.addKeyword(discriminator)\n }\n\n _addDefaultMetaSchema(): void {\n super._addDefaultMetaSchema()\n if (!this.opts.meta) return\n const metaSchema = this.opts.$data\n ? this.$dataMetaSchema(draft7MetaSchema, META_SUPPORT_DATA)\n : draft7MetaSchema\n this.addMetaSchema(metaSchema, META_SCHEMA_ID, false)\n this.refs[\"http://json-schema.org/schema\"] = META_SCHEMA_ID\n }\n\n defaultMeta(): string | AnySchemaObject | undefined {\n return (this.opts.defaultMeta =\n super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined))\n }\n}\n\nmodule.exports = exports = Ajv\nmodule.exports.Ajv = Ajv\nObject.defineProperty(exports, \"__esModule\", {value: true})\n\nexport default Ajv\n\nexport {\n Format,\n FormatDefinition,\n AsyncFormatDefinition,\n KeywordDefinition,\n KeywordErrorDefinition,\n CodeKeywordDefinition,\n MacroKeywordDefinition,\n FuncKeywordDefinition,\n Vocabulary,\n Schema,\n SchemaObject,\n AnySchemaObject,\n AsyncSchema,\n AnySchema,\n ValidateFunction,\n AsyncValidateFunction,\n SchemaValidateFunction,\n ErrorObject,\n ErrorNoParams,\n} from \"./types\"\n\nexport {Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions} from \"./core\"\nexport {SchemaCxt, SchemaObjCxt} from \"./compile\"\nexport {KeywordCxt} from \"./compile/validate\"\nexport {DefinedError} from \"./vocabularies/errors\"\nexport {JSONType} from \"./compile/rules\"\nexport {JSONSchemaType} from \"./types/json-schema\"\nexport {_, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions} from \"./compile/codegen\"\nexport {default as ValidationError} from \"./runtime/validation_error\"\nexport {default as MissingRefError} from \"./compile/ref_error\"\n", "import type {Format, FormatDefinition} from \"ajv\"\nimport type {FormatValidator, FormatCompare} from \"ajv/dist/types\"\n\nexport type FormatMode = \"fast\" | \"full\"\n\nexport type FormatName =\n | \"date\"\n | \"time\"\n | \"date-time\"\n | \"duration\"\n | \"uri\"\n | \"uri-reference\"\n | \"uri-template\"\n | \"url\"\n | \"email\"\n | \"hostname\"\n | \"ipv4\"\n | \"ipv6\"\n | \"regex\"\n | \"uuid\"\n | \"json-pointer\"\n | \"json-pointer-uri-fragment\"\n | \"relative-json-pointer\"\n | \"byte\"\n | \"int32\"\n | \"int64\"\n | \"float\"\n | \"double\"\n | \"password\"\n | \"binary\"\n\nexport type DefinedFormats = {\n [key in FormatName]: Format\n}\n\nfunction fmtDef(\n validate: RegExp | FormatValidator<string>,\n compare: FormatCompare<string>\n): FormatDefinition<string> {\n return {validate, compare}\n}\n\nexport const fullFormats: DefinedFormats = {\n // date: http://tools.ietf.org/html/rfc3339#section-5.6\n date: fmtDef(date, compareDate),\n // date-time: http://tools.ietf.org/html/rfc3339#section-5.6\n time: fmtDef(time, compareTime),\n \"date-time\": fmtDef(date_time, compareDateTime),\n // duration: https://tools.ietf.org/html/rfc3339#appendix-A\n duration: /^P(?!$)((\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+S)?)?|(\\d+W)?)$/,\n uri,\n \"uri-reference\":\n /^(?:[a-z][a-z0-9+\\-.]*:)?(?:\\/?\\/(?:(?:[a-z0-9\\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\\.[a-z0-9\\-._~!$&'()*+,;=:]+)\\]|(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)|(?:[a-z0-9\\-._~!$&'\"()*+,;=]|%[0-9a-f]{2})*)(?::\\d*)?(?:\\/(?:[a-z0-9\\-._~!$&'\"()*+,;=:@]|%[0-9a-f]{2})*)*|\\/(?:(?:[a-z0-9\\-._~!$&'\"()*+,;=:@]|%[0-9a-f]{2})+(?:\\/(?:[a-z0-9\\-._~!$&'\"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\\-._~!$&'\"()*+,;=:@]|%[0-9a-f]{2})+(?:\\/(?:[a-z0-9\\-._~!$&'\"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\\?(?:[a-z0-9\\-._~!$&'\"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\\-._~!$&'\"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,\n // uri-template: https://tools.ietf.org/html/rfc6570\n \"uri-template\":\n /^(?:(?:[^\\x00-\\x20\"'<>%\\\\^`{|}]|%[0-9a-f]{2})|\\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\\*)?)*\\})*$/i,\n // For the source: https://gist.github.com/dperini/729294\n // For test cases: https://mathiasbynens.be/demo/url-regex\n url: /^(?:https?|ftp):\\/\\/(?:\\S+(?::\\S*)?@)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z0-9\\u{00a1}-\\u{ffff}]+-)*[a-z0-9\\u{00a1}-\\u{ffff}]+)(?:\\.(?:[a-z0-9\\u{00a1}-\\u{ffff}]+-)*[a-z0-9\\u{00a1}-\\u{ffff}]+)*(?:\\.(?:[a-z\\u{00a1}-\\u{ffff}]{2,})))(?::\\d{2,5})?(?:\\/[^\\s]*)?$/iu,\n email:\n /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,\n hostname:\n /^(?=.{1,253}\\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\\.?$/i,\n // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html\n ipv4: /^(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$/,\n ipv6: /^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))$/i,\n regex,\n // uuid: http://tools.ietf.org/html/rfc4122\n uuid: /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,\n // JSON-pointer: https://tools.ietf.org/html/rfc6901\n // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A\n \"json-pointer\": /^(?:\\/(?:[^~/]|~0|~1)*)*$/,\n \"json-pointer-uri-fragment\": /^#(?:\\/(?:[a-z0-9_\\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,\n // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00\n \"relative-json-pointer\": /^(?:0|[1-9][0-9]*)(?:#|(?:\\/(?:[^~/]|~0|~1)*)*)$/,\n // the following formats are used by the openapi specification: https://spec.openapis.org/oas/v3.0.0#data-types\n // byte: https://github.com/miguelmota/is-base64\n byte,\n // signed 32 bit integer\n int32: {type: \"number\", validate: validateInt32},\n // signed 64 bit integer\n int64: {type: \"number\", validate: validateInt64},\n // C-type float\n float: {type: \"number\", validate: validateNumber},\n // C-type double\n double: {type: \"number\", validate: validateNumber},\n // hint to the UI to hide input strings\n password: true,\n // unchecked string payload\n binary: true,\n}\n\nexport const fastFormats: DefinedFormats = {\n ...fullFormats,\n date: fmtDef(/^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d$/, compareDate),\n time: fmtDef(\n /^(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)?$/i,\n compareTime\n ),\n \"date-time\": fmtDef(\n /^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d[t\\s](?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)$/i,\n compareDateTime\n ),\n // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js\n uri: /^(?:[a-z][a-z0-9+\\-.]*:)(?:\\/?\\/)?[^\\s]*$/i,\n \"uri-reference\": /^(?:(?:[a-z][a-z0-9+\\-.]*:)?\\/?\\/)?(?:[^\\\\\\s#][^\\s#]*)?(?:#[^\\\\\\s]*)?$/i,\n // email (sources from jsen validator):\n // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363\n // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'wilful violation')\n email:\n /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,\n}\n\nexport const formatNames = Object.keys(fullFormats) as FormatName[]\n\nfunction isLeapYear(year: number): boolean {\n // https://tools.ietf.org/html/rfc3339#appendix-C\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0)\n}\n\nconst DATE = /^(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)$/\nconst DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]\n\nfunction date(str: string): boolean {\n // full-date from http://tools.ietf.org/html/rfc3339#section-5.6\n const matches: string[] | null = DATE.exec(str)\n if (!matches) return false\n const year: number = +matches[1]\n const month: number = +matches[2]\n const day: number = +matches[3]\n return (\n month >= 1 &&\n month <= 12 &&\n day >= 1 &&\n day <= (month === 2 && isLeapYear(year) ? 29 : DAYS[month])\n )\n}\n\nfunction compareDate(d1: string, d2: string): number | undefined {\n if (!(d1 && d2)) return undefined\n if (d1 > d2) return 1\n if (d1 < d2) return -1\n return 0\n}\n\nconst TIME = /^(\\d\\d):(\\d\\d):(\\d\\d)(\\.\\d+)?(z|[+-]\\d\\d(?::?\\d\\d)?)?$/i\n\nfunction time(str: string, withTimeZone?: boolean): boolean {\n const matches: string[] | null = TIME.exec(str)\n if (!matches) return false\n\n const hour: number = +matches[1]\n const minute: number = +matches[2]\n const second: number = +matches[3]\n const timeZone: string = matches[5]\n return (\n ((hour <= 23 && minute <= 59 && second <= 59) ||\n (hour === 23 && minute === 59 && second === 60)) &&\n (!withTimeZone || timeZone !== \"\")\n )\n}\n\nfunction compareTime(t1: string, t2: string): number | undefined {\n if (!(t1 && t2)) return undefined\n const a1 = TIME.exec(t1)\n const a2 = TIME.exec(t2)\n if (!(a1 && a2)) return undefined\n t1 = a1[1] + a1[2] + a1[3] + (a1[4] || \"\")\n t2 = a2[1] + a2[2] + a2[3] + (a2[4] || \"\")\n if (t1 > t2) return 1\n if (t1 < t2) return -1\n return 0\n}\n\nconst DATE_TIME_SEPARATOR = /t|\\s/i\nfunction date_time(str: string): boolean {\n // http://tools.ietf.org/html/rfc3339#section-5.6\n const dateTime: string[] = str.split(DATE_TIME_SEPARATOR)\n return dateTime.length === 2 && date(dateTime[0]) && time(dateTime[1], true)\n}\n\nfunction compareDateTime(dt1: string, dt2: string): number | undefined {\n if (!(dt1 && dt2)) return undefined\n const [d1, t1] = dt1.split(DATE_TIME_SEPARATOR)\n const [d2, t2] = dt2.split(DATE_TIME_SEPARATOR)\n const res = compareDate(d1, d2)\n if (res === undefined) return undefined\n return res || compareTime(t1, t2)\n}\n\nconst NOT_URI_FRAGMENT = /\\/|:/\nconst URI =\n /^(?:[a-z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~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i\n\nfunction uri(str: string): boolean {\n // http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required \".\"\n return NOT_URI_FRAGMENT.test(str) && URI.test(str)\n}\n\nconst BYTE = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm\n\nfunction byte(str: string): boolean {\n BYTE.lastIndex = 0\n return BYTE.test(str)\n}\n\nconst MIN_INT32 = -(2 ** 31)\nconst MAX_INT32 = 2 ** 31 - 1\n\nfunction validateInt32(value: number): boolean {\n return Number.isInteger(value) && value <= MAX_INT32 && value >= MIN_INT32\n}\n\nfunction validateInt64(value: number): boolean {\n // JSON and javascript max Int is 2**53, so any int that passes isInteger is valid for Int64\n return Number.isInteger(value)\n}\n\nfunction validateNumber(): boolean {\n return true\n}\n\nconst Z_ANCHOR = /[^\\\\]\\\\Z/\nfunction regex(str: string): boolean {\n if (Z_ANCHOR.test(str)) return false\n try {\n new RegExp(str)\n return true\n } catch (e) {\n return false\n }\n}\n", "import type Ajv from \"ajv\"\nimport type {\n Plugin,\n CodeKeywordDefinition,\n KeywordErrorDefinition,\n Code,\n Name,\n ErrorObject,\n} from \"ajv\"\nimport type {AddedFormat} from \"ajv/dist/types\"\nimport type {Rule} from \"ajv/dist/compile/rules\"\nimport {KeywordCxt} from \"ajv\"\nimport {_, str, or, getProperty, operators} from \"ajv/dist/compile/codegen\"\n\ntype Kwd = \"formatMaximum\" | \"formatMinimum\" | \"formatExclusiveMaximum\" | \"formatExclusiveMinimum\"\n\ntype Comparison = \"<=\" | \">=\" | \"<\" | \">\"\n\nconst ops = operators\n\nconst KWDs: {[K in Kwd]: {okStr: Comparison; ok: Code; fail: Code}} = {\n formatMaximum: {okStr: \"<=\", ok: ops.LTE, fail: ops.GT},\n formatMinimum: {okStr: \">=\", ok: ops.GTE, fail: ops.LT},\n formatExclusiveMaximum: {okStr: \"<\", ok: ops.LT, fail: ops.GTE},\n formatExclusiveMinimum: {okStr: \">\", ok: ops.GT, fail: ops.LTE},\n}\n\nexport type LimitFormatError = ErrorObject<Kwd, {limit: string; comparison: Comparison}>\n\nconst error: KeywordErrorDefinition = {\n message: ({keyword, schemaCode}) => str`should be ${KWDs[keyword as Kwd].okStr} ${schemaCode}`,\n params: ({keyword, schemaCode}) =>\n _`{comparison: ${KWDs[keyword as Kwd].okStr}, limit: ${schemaCode}}`,\n}\n\nexport const formatLimitDefinition: CodeKeywordDefinition = {\n keyword: Object.keys(KWDs),\n type: \"string\",\n schemaType: \"string\",\n $data: true,\n error,\n code(cxt) {\n const {gen, data, schemaCode, keyword, it} = cxt\n const {opts, self} = it\n if (!opts.validateFormats) return\n\n const fCxt = new KeywordCxt(it, (self.RULES.all.format as Rule).definition, \"format\")\n if (fCxt.$data) validate$DataFormat()\n else validateFormat()\n\n function validate$DataFormat(): void {\n const fmts = gen.scopeValue(\"formats\", {\n ref: self.formats,\n code: opts.code.formats,\n })\n const fmt = gen.const(\"fmt\", _`${fmts}[${fCxt.schemaCode}]`)\n cxt.fail$data(\n or(\n _`typeof ${fmt} != \"object\"`,\n _`${fmt} instanceof RegExp`,\n _`typeof ${fmt}.compare != \"function\"`,\n compareCode(fmt)\n )\n )\n }\n\n function validateFormat(): void {\n const format = fCxt.schema as string\n const fmtDef: AddedFormat | undefined = self.formats[format]\n if (!fmtDef || fmtDef === true) return\n if (\n typeof fmtDef != \"object\" ||\n fmtDef instanceof RegExp ||\n typeof fmtDef.compare != \"function\"\n ) {\n throw new Error(`\"${keyword}\": format \"${format}\" does not define \"compare\" function`)\n }\n const fmt = gen.scopeValue(\"formats\", {\n key: format,\n ref: fmtDef,\n code: opts.code.formats ? _`${opts.code.formats}${getProperty(format)}` : undefined,\n })\n\n cxt.fail$data(compareCode(fmt))\n }\n\n function compareCode(fmt: Name): Code {\n return _`${fmt}.compare(${data}, ${schemaCode}) ${KWDs[keyword as Kwd].fail} 0`\n }\n },\n dependencies: [\"format\"],\n}\n\nconst formatLimitPlugin: Plugin<undefined> = (ajv: Ajv): Ajv => {\n ajv.addKeyword(formatLimitDefinition)\n return ajv\n}\n\nexport default formatLimitPlugin\n", "import {\n DefinedFormats,\n FormatMode,\n FormatName,\n formatNames,\n fastFormats,\n fullFormats,\n} from \"./formats\"\nimport formatLimit from \"./limit\"\nimport type Ajv from \"ajv\"\nimport type {Plugin, Format} from \"ajv\"\nimport {_, Name} from \"ajv/dist/compile/codegen\"\n\nexport {FormatMode, FormatName} from \"./formats\"\nexport {LimitFormatError} from \"./limit\"\nexport interface FormatOptions {\n mode?: FormatMode\n formats?: FormatName[]\n keywords?: boolean\n}\n\nexport type FormatsPluginOptions = FormatName[] | FormatOptions\n\nexport interface FormatsPlugin extends Plugin<FormatsPluginOptions> {\n get: (format: FormatName, mode?: FormatMode) => Format\n}\n\nconst fullName = new Name(\"fullFormats\")\nconst fastName = new Name(\"fastFormats\")\n\nconst formatsPlugin: FormatsPlugin = (\n ajv: Ajv,\n opts: FormatsPluginOptions = {keywords: true}\n): Ajv => {\n if (Array.isArray(opts)) {\n addFormats(ajv, opts, fullFormats, fullName)\n return ajv\n }\n const [formats, exportName] =\n opts.mode === \"fast\" ? [fastFormats, fastName] : [fullFormats, fullName]\n const list = opts.formats || formatNames\n addFormats(ajv, list, formats, exportName)\n if (opts.keywords) formatLimit(ajv)\n return ajv\n}\n\nformatsPlugin.get = (name: FormatName, mode: FormatMode = \"full\"): Format => {\n const formats = mode === \"fast\" ? fastFormats : fullFormats\n const f = formats[name]\n if (!f) throw new Error(`Unknown format \"${name}\"`)\n return f\n}\n\nfunction addFormats(ajv: Ajv, list: FormatName[], fs: DefinedFormats, exportName: Name): void {\n ajv.opts.code.formats ??= _`require(\"ajv-formats/dist/formats\").${exportName}`\n for (const f of list) ajv.addFormat(f, fs[f])\n}\n\nmodule.exports = exports = formatsPlugin\nObject.defineProperty(exports, \"__esModule\", {value: true})\n\nexport default formatsPlugin\n", "/** Determines whether a `thing` is an object for the purposes of RJSF. In this case, `thing` is an object if it has\n * the type `object` but is NOT null, an array or a File.\n *\n * @param thing - The thing to check to see whether it is an object\n * @returns - True if it is a non-null, non-array, non-File object\n */\nexport default function isObject(thing: any): thing is object {\n if (typeof thing !== 'object' || thing === null) {\n return false;\n }\n // lastModified is guaranteed to be a number on a File instance\n // as per https://w3c.github.io/FileAPI/#dfn-lastModified\n if (typeof thing.lastModified === 'number' && typeof File !== 'undefined' && thing instanceof File) {\n return false;\n }\n // getMonth is guaranteed to be a method on a Date instance\n // as per https://tc39.es/ecma262/multipage/numbers-and-dates.html#sec-date.prototype.getmonth\n if (typeof thing.getMonth === 'function' && typeof Date !== 'undefined' && thing instanceof Date) {\n return false;\n }\n return !Array.isArray(thing);\n}\n", "import isObject from './isObject';\nimport type { RJSFSchema, StrictRJSFSchema } from './types';\n\n/** Checks the schema to see if it is allowing additional items, by verifying that `schema.additionalItems` is an\n * object. The user is warned in the console if `schema.additionalItems` has the value `true`.\n *\n * @param schema - The schema object to check\n * @returns - True if additional items is allowed, otherwise false\n */\nexport default function allowAdditionalItems<S extends StrictRJSFSchema = RJSFSchema>(schema: S) {\n if (schema.additionalItems === true) {\n // oxlint-disable-next-line no-console\n console.warn('additionalItems=true is currently not supported');\n }\n return isObject(schema.additionalItems);\n}\n", "/**\n * Determines the locale-specific decimal separator.\n * It uses the provided locale or the first locale in navigator.languages (if available) and falls back to \"en\".\n *\n * @param languages - Optional array of locales or a single locale string\n * @returns The decimal separator character (typically '.' or ',').\n */\nexport default function getDecimalSeparator(languages?: string | string[]): string {\n const locales = languages || (typeof navigator !== 'undefined' ? navigator.languages : undefined);\n if (locales) {\n try {\n const formatter = new Intl.NumberFormat(locales);\n const parts = formatter.formatToParts(1.1);\n return parts.find((part) => part.type === 'decimal')?.value || '.';\n } catch (e) {\n // Fallback\n }\n }\n return '.';\n}\n", "import getDecimalSeparator from './getDecimalSeparator';\n\n/** Attempts to convert the string into a number. If an empty string is provided, then `undefined` is returned.\n * If a `null` is provided, it is returned. If the string ends in a `.` or the locale-specific separator then the\n * string is returned because the user may be in the middle of typing a float number. If a number ends in a pattern\n * like `.0`, `.20`, `.030`, string is returned because the user may be typing number that will end in a non-zero\n * digit. Otherwise, the string is wrapped by `Number()` and if that result is not `NaN`, that number will be\n * returned, otherwise the string `value` will be.\n *\n * @param value - The string or null value to convert to a number\n * @returns - The `value` converted to a number when appropriate, otherwise the `value`\n */\nexport default function asNumber(value: string | null) {\n if (value === '') {\n return undefined;\n }\n if (value === null) {\n return null;\n }\n\n const separator = getDecimalSeparator();\n\n // Normalize separator to standard '.' for pattern checking and parsing\n const standardValue = typeof value === 'string' && separator !== '.' ? value.replace(separator, '.') : value;\n\n // oxlint-disable-next-line typescript/prefer-string-starts-ends-with -- regex test() coerces undefined to \"undefined\" safely; endsWith() throws on undefined values passed at runtime\n if (/\\.$/.test(standardValue)) {\n // '3.' can't really be considered a number even if it parses in js. The\n // user is most likely entering a float.\n return value;\n }\n // oxlint-disable-next-line typescript/prefer-string-starts-ends-with -- same as above\n if (/\\.0$/.test(standardValue)) {\n // we need to return this as a string here, to allow for input like 3.07\n return value;\n }\n\n if (/\\.\\d*0$/.test(standardValue)) {\n // It's a number, that's cool - but we need it as a string so it doesn't screw\n // with the user when entering dollar amounts or other values (such as those with\n // specific precision or number of significant digits)\n return value;\n }\n\n const n = Number(standardValue);\n const valid = typeof n === 'number' && !Number.isNaN(n);\n\n return valid ? n : value;\n}\n", "/** Below are the list of all the keys into various elements of a RJSFSchema or UiSchema that are used by the various\n * utility functions. In addition to those keys, there are the special `ADDITIONAL_PROPERTY_FLAG`,\n * `RJSF_REF_KEY`, and `RJSF_REF_CYCLE_KEY` Symbols that are added to a schema under certain conditions by the\n * `retrieveSchema()` utility. Using Symbols keeps these internal markers invisible to JSON serialisation and\n * JSON Schema validators (AJV, ATA, etc.), which only enumerate string-keyed properties.\n */\nexport const ADDITIONAL_PROPERTY_FLAG = Symbol('__additional_property');\nexport const ADDITIONAL_PROPERTIES_KEY = 'additionalProperties';\nexport const ALL_OF_KEY = 'allOf';\nexport const ANY_OF_KEY = 'anyOf';\nexport const CONST_KEY = 'const';\nexport const DEFAULT_KEY = 'default';\nexport const DEFINITIONS_KEY = 'definitions';\nexport const DEPENDENCIES_KEY = 'dependencies';\nexport const ENUM_KEY = 'enum';\nexport const ERRORS_KEY = '__errors';\nexport const ID_KEY = '$id';\nexport const IF_KEY = 'if';\nexport const ITEMS_KEY = 'items';\nexport const JUNK_OPTION_ID = '_$junk_option_schema_id$_';\nexport const NAME_KEY = '$name';\nexport const ONE_OF_KEY = 'oneOf';\nexport const PATTERN_PROPERTIES_KEY = 'patternProperties';\nexport const PROPERTIES_KEY = 'properties';\nexport const READONLY_KEY = 'readonly';\nexport const REQUIRED_KEY = 'required';\nexport const SUBMIT_BTN_OPTIONS_KEY = 'submitButtonOptions';\nexport const REF_KEY = '$ref';\nexport const RJSF_REF_KEY = Symbol('__rjsf_ref');\nexport const RJSF_REF_CYCLE_KEY = Symbol('__rjsf_ref_cycle');\nexport const SCHEMA_KEY = '$schema';\nexport const DEFAULT_ID_PREFIX = 'root';\nexport const DEFAULT_ID_SEPARATOR = '_';\n/** The path of the discriminator value returned by the schema endpoint.\n * The discriminator is the value in a `oneOf` that determines which option is selected.\n */\nexport const DISCRIMINATOR_PATH = ['discriminator', 'propertyName'];\n/** The name of the `formContext` attribute in the React JSON Schema Form Registry\n */\nexport const FORM_CONTEXT_NAME = 'formContext';\n\n/** The name of the `layoutGridLookupMap` attribute in the form context\n */\nexport const LOOKUP_MAP_NAME = 'layoutGridLookupMap';\nexport const RJSF_PREFIX_KEY = '__rjsf';\nexport const RJSF_ADDITIONAL_PROPERTIES_FLAG = `${RJSF_PREFIX_KEY}_additionalProperties`;\nexport const ROOT_SCHEMA_PREFIX = `${RJSF_PREFIX_KEY}_rootSchema`;\nexport const UI_FIELD_KEY = 'ui:field';\nexport const UI_WIDGET_KEY = 'ui:widget';\nexport const UI_OPTIONS_KEY = 'ui:options';\nexport const UI_GLOBAL_OPTIONS_KEY = 'ui:globalOptions';\nexport const UI_DEFINITIONS_KEY = 'ui:definitions';\n\n/** The JSON Schema version strings\n */\nexport const JSON_SCHEMA_DRAFT_2019_09 = 'https://json-schema.org/draft/2019-09/schema';\nexport const JSON_SCHEMA_DRAFT_2020_12 = 'https://json-schema.org/draft/2020-12/schema';\n", "import { UI_OPTIONS_KEY, UI_WIDGET_KEY } from './constants';\nimport isObject from './isObject';\nimport type {\n FormContextType,\n GlobalUISchemaOptions,\n RJSFSchema,\n StrictRJSFSchema,\n UIOptionsType,\n UiSchema,\n} from './types';\n\n/** Get all passed options from ui:options, and ui:<optionName>, returning them in an object with the `ui:`\n * stripped off. Any `globalOptions` will always be returned, unless they are overridden by options in the `uiSchema`.\n *\n * @param [uiSchema={}] - The UI Schema from which to get any `ui:xxx` options\n * @param [globalOptions={}] - The optional Global UI Schema from which to get any fallback `xxx` options\n * @returns - An object containing all the `ui:xxx` options with the `ui:` stripped off along with all `globalOptions`\n */\nexport default function getUiOptions<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n uiSchema: UiSchema<T, S, F> = {},\n globalOptions: GlobalUISchemaOptions = {},\n): UIOptionsType<T, S, F> {\n // Handle null or undefined uiSchema\n if (!uiSchema) {\n return { ...globalOptions };\n }\n return Object.keys(uiSchema)\n .filter((key) => key.startsWith('ui:'))\n .reduce(\n (options, key) => {\n const value = uiSchema[key];\n if (key === UI_WIDGET_KEY && isObject(value)) {\n // oxlint-disable-next-line no-console\n console.error('Setting options via ui:widget object is no longer supported, use ui:options instead');\n return options;\n }\n if (key === UI_OPTIONS_KEY && isObject(value)) {\n return { ...options, ...value };\n }\n return { ...options, [key.substring(3)]: value };\n },\n { ...globalOptions },\n );\n}\n", "import getUiOptions from './getUiOptions';\nimport type { FormContextType, RJSFSchema, StrictRJSFSchema, UiSchema } from './types';\n\n/** Checks whether the field described by `schema`, having the `uiSchema` and `formData` supports expanding. The UI for\n * the field can expand if it has additional properties, is not forced as non-expandable by the `uiSchema` and the\n * `formData` object doesn't already have `schema.maxProperties` elements.\n *\n * @param schema - The schema for the field that is being checked\n * @param [uiSchema={}] - The uiSchema for the field\n * @param [formData] - The formData for the field\n * @returns - True if the schema element has additionalProperties, is expandable, and not at the maxProperties limit\n */\nexport default function canExpand<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n schema: RJSFSchema,\n uiSchema: UiSchema<T, S, F> = {},\n formData?: T,\n) {\n if (!(schema.additionalProperties || schema.patternProperties)) {\n return false;\n }\n const { expandable = true } = getUiOptions<T, S, F>(uiSchema);\n if (expandable === false) {\n return expandable;\n }\n // if ui:options.expandable was not explicitly set to false, we can add\n // another property if we have not exceeded maxProperties yet\n if (schema.maxProperties !== undefined && formData) {\n return Object.keys(formData).length < schema.maxProperties;\n }\n return true;\n}\n", "/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nexport default freeGlobal;\n", "import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nexport default root;\n", "import root from './_root.js';\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nexport default Symbol;\n", "import Symbol from './_Symbol.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nexport default getRawTag;\n", "/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nexport default objectToString;\n", "import Symbol from './_Symbol.js';\nimport getRawTag from './_getRawTag.js';\nimport objectToString from './_objectToString.js';\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nexport default baseGetTag;\n", "/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nexport default overArg;\n", "import overArg from './_overArg.js';\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nexport default getPrototype;\n", "/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nexport default isObjectLike;\n", "import baseGetTag from './_baseGetTag.js';\nimport getPrototype from './_getPrototype.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nexport default isPlainObject;\n", "import isPlainObject from 'lodash/isPlainObject';\n\nimport { ERRORS_KEY } from './constants';\nimport type { FieldValidation, FormValidation, GenericObjectType } from './types';\n\n/** Given a `formData` object, recursively creates a `FormValidation` error handling structure around it\n *\n * @param formData - The form data around which the error handler is created\n * @returns - A `FormValidation` object based on the `formData` structure\n */\nexport default function createErrorHandler<T = any>(formData: T): FormValidation<T> {\n const handler: FieldValidation = {\n // We store the list of errors for this node in a property named __errors\n // to avoid name collision with a possible sub schema field named\n // 'errors' (see `utils.toErrorSchema`).\n [ERRORS_KEY]: [],\n addError(message: string) {\n this[ERRORS_KEY]!.push(message);\n },\n };\n if (Array.isArray(formData)) {\n return formData.reduce((acc, value, key) => ({ ...acc, [key]: createErrorHandler(value) }), handler);\n }\n if (isPlainObject(formData)) {\n const formObject: GenericObjectType = formData as GenericObjectType;\n return Object.keys(formObject).reduce(\n (acc, key) => ({ ...acc, [key]: createErrorHandler(formObject[key]) }),\n handler as FormValidation<T>,\n );\n }\n return handler as FormValidation<T>;\n}\n", "/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nexport default isArray;\n", "import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nexport default isSymbol;\n", "import isArray from './isArray.js';\nimport isSymbol from './isSymbol.js';\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/;\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n}\n\nexport default isKey;\n", "/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nexport default isObject;\n", "import baseGetTag from './_baseGetTag.js';\nimport isObject from './isObject.js';\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nexport default isFunction;\n", "import root from './_root.js';\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nexport default coreJsData;\n", "import coreJsData from './_coreJsData.js';\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nexport default isMasked;\n", "/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nexport default toSource;\n", "import isFunction from './isFunction.js';\nimport isMasked from './_isMasked.js';\nimport isObject from './isObject.js';\nimport toSource from './_toSource.js';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nexport default baseIsNative;\n", "/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nexport default getValue;\n", "import baseIsNative from './_baseIsNative.js';\nimport getValue from './_getValue.js';\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nexport default getNative;\n", "import getNative from './_getNative.js';\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nexport default nativeCreate;\n", "import nativeCreate from './_nativeCreate.js';\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nexport default hashClear;\n", "/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nexport default hashDelete;\n", "import nativeCreate from './_nativeCreate.js';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nexport default hashGet;\n", "import nativeCreate from './_nativeCreate.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nexport default hashHas;\n", "import nativeCreate from './_nativeCreate.js';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nexport default hashSet;\n", "import hashClear from './_hashClear.js';\nimport hashDelete from './_hashDelete.js';\nimport hashGet from './_hashGet.js';\nimport hashHas from './_hashHas.js';\nimport hashSet from './_hashSet.js';\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nexport default Hash;\n", "/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nexport default listCacheClear;\n", "/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nexport default eq;\n", "import eq from './eq.js';\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nexport default assocIndexOf;\n", "import assocIndexOf from './_assocIndexOf.js';\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nexport default listCacheDelete;\n", "import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nexport default listCacheGet;\n", "import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nexport default listCacheHas;\n", "import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nexport default listCacheSet;\n", "import listCacheClear from './_listCacheClear.js';\nimport listCacheDelete from './_listCacheDelete.js';\nimport listCacheGet from './_listCacheGet.js';\nimport listCacheHas from './_listCacheHas.js';\nimport listCacheSet from './_listCacheSet.js';\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nexport default ListCache;\n", "import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nexport default Map;\n", "import Hash from './_Hash.js';\nimport ListCache from './_ListCache.js';\nimport Map from './_Map.js';\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nexport default mapCacheClear;\n", "/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nexport default isKeyable;\n", "import isKeyable from './_isKeyable.js';\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nexport default getMapData;\n", "import getMapData from './_getMapData.js';\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nexport default mapCacheDelete;\n", "import getMapData from './_getMapData.js';\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nexport default mapCacheGet;\n", "import getMapData from './_getMapData.js';\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nexport default mapCacheHas;\n", "import getMapData from './_getMapData.js';\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nexport default mapCacheSet;\n", "import mapCacheClear from './_mapCacheClear.js';\nimport mapCacheDelete from './_mapCacheDelete.js';\nimport mapCacheGet from './_mapCacheGet.js';\nimport mapCacheHas from './_mapCacheHas.js';\nimport mapCacheSet from './_mapCacheSet.js';\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nexport default MapCache;\n", "import MapCache from './_MapCache.js';\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n}\n\n// Expose `MapCache`.\nmemoize.Cache = MapCache;\n\nexport default memoize;\n", "import memoize from './memoize.js';\n\n/** Used as the maximum memoize cache size. */\nvar MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nfunction memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n}\n\nexport default memoizeCapped;\n", "import memoizeCapped from './_memoizeCapped.js';\n\n/** Used to match property names within property paths. */\nvar rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n});\n\nexport default stringToPath;\n", "/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nexport default arrayMap;\n", "import Symbol from './_Symbol.js';\nimport arrayMap from './_arrayMap.js';\nimport isArray from './isArray.js';\nimport isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nexport default baseToString;\n", "import baseToString from './_baseToString.js';\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\nexport default toString;\n", "import isArray from './isArray.js';\nimport isKey from './_isKey.js';\nimport stringToPath from './_stringToPath.js';\nimport toString from './toString.js';\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n}\n\nexport default castPath;\n", "import isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nexport default toKey;\n", "import castPath from './_castPath.js';\nimport toKey from './_toKey.js';\n\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n}\n\nexport default baseGet;\n", "import baseGet from './_baseGet.js';\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n}\n\nexport default get;\n", "const { getOwnPropertyNames, getOwnPropertySymbols } = Object;\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst { hasOwnProperty } = Object.prototype;\n/**\n * Combine two comparators into a single comparators.\n */\nfunction combineComparators(comparatorA, comparatorB) {\n return function isEqual(a, b, state) {\n return comparatorA(a, b, state) && comparatorB(a, b, state);\n };\n}\n/**\n * Wrap the provided `areItemsEqual` method to manage the circular state, allowing\n * for circular references to be safely included in the comparison without creating\n * stack overflows.\n */\nfunction createIsCircular(areItemsEqual) {\n return function isCircular(a, b, state) {\n if (!a || !b || typeof a !== 'object' || typeof b !== 'object') {\n return areItemsEqual(a, b, state);\n }\n const { cache } = state;\n const cachedA = cache.get(a);\n const cachedB = cache.get(b);\n if (cachedA && cachedB) {\n return cachedA === b && cachedB === a;\n }\n cache.set(a, b);\n cache.set(b, a);\n const result = areItemsEqual(a, b, state);\n cache.delete(a);\n cache.delete(b);\n return result;\n };\n}\n/**\n * Get the properties to strictly examine, which include both own properties that are\n * not enumerable and symbol properties.\n */\nfunction getStrictProperties(object) {\n const symbols = getOwnPropertySymbols(object);\n return symbols.length\n ? getOwnPropertyNames(object).concat(symbols)\n : getOwnPropertyNames(object);\n}\n/**\n * Whether the object contains the property passed as an own property.\n */\nconst hasOwn = \n// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\nObject.hasOwn || ((object, property) => hasOwnProperty.call(object, property));\n\nconst PREACT_VNODE = '__v';\nconst PREACT_OWNER = '__o';\nconst REACT_OWNER = '_owner';\nconst { getOwnPropertyDescriptor, keys } = Object;\n/**\n * Whether the values passed are equal based on a [SameValue](https://262.ecma-international.org/7.0/#sec-samevalue) basis.\n * Simplified, this maps to if the two values are referentially equal to one another (`a === b`) or both are `NaN`.\n *\n * @note\n * When available in the environment, this is just a re-export of the global\n * [`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is) method.\n */\nconst sameValueEqual = \n// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\nObject.is\n || function sameValueEqual(a, b) {\n return a === b ? a !== 0 || 1 / a === 1 / b : a !== a && b !== b;\n };\n/**\n * Whether the values passed are equal based on a [SameValue](https://262.ecma-international.org/7.0/#sec-samevaluezero) basis.\n * Simplified, this maps to if the two values are referentially equal to one another (`a === b`), both are `NaN`, or both\n * are either positive or negative zero.\n */\nfunction sameValueZeroEqual(a, b) {\n return a === b || (a !== a && b !== b);\n}\n/**\n * Whether the values passed are equal based on a\n * [Strict Equality Comparison](https://262.ecma-international.org/7.0/#sec-strict-equality-comparison) basis.\n * Simplified, this maps to if the two values are referentially equal to one another (`a === b`).\n *\n * @note\n * This is mainly available as a convenience function, such as being a default when a function to determine equality between\n * two objects is used.\n */\nfunction strictEqual(a, b) {\n return a === b;\n}\n/**\n * Whether the array buffers are equal in value.\n */\nfunction areArrayBuffersEqual(a, b) {\n return a.byteLength === b.byteLength && areTypedArraysEqual(new Uint8Array(a), new Uint8Array(b));\n}\n/**\n * Whether the arrays are equal in value.\n */\nfunction areArraysEqual(a, b, state) {\n let index = a.length;\n if (b.length !== index) {\n return false;\n }\n while (index-- > 0) {\n if (!state.equals(a[index], b[index], index, index, a, b, state)) {\n return false;\n }\n }\n return true;\n}\n/**\n * Whether the dataviews are equal in value.\n */\nfunction areDataViewsEqual(a, b) {\n return (a.byteLength === b.byteLength\n && areTypedArraysEqual(new Uint8Array(a.buffer, a.byteOffset, a.byteLength), new Uint8Array(b.buffer, b.byteOffset, b.byteLength)));\n}\n/**\n * Whether the dates passed are equal in value.\n */\nfunction areDatesEqual(a, b) {\n return sameValueEqual(a.getTime(), b.getTime());\n}\n/**\n * Whether the errors passed are equal in value.\n */\nfunction areErrorsEqual(a, b) {\n return a.name === b.name && a.message === b.message && a.cause === b.cause && a.stack === b.stack;\n}\n/**\n * Whether the `Map`s are equal in value.\n */\nfunction areMapsEqual(a, b, state) {\n const size = a.size;\n if (size !== b.size) {\n return false;\n }\n if (!size) {\n return true;\n }\n const matchedIndices = new Uint8Array(size);\n const aIterable = a.entries();\n let aResult;\n let bResult;\n let index = 0;\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while ((aResult = aIterable.next())) {\n if (aResult.done) {\n break;\n }\n const bIterable = b.entries();\n let hasMatch = 0;\n let matchIndex = 0;\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while ((bResult = bIterable.next())) {\n if (bResult.done) {\n break;\n }\n if (matchedIndices[matchIndex]) {\n matchIndex++;\n continue;\n }\n const aEntry = aResult.value;\n const bEntry = bResult.value;\n if (state.equals(aEntry[0], bEntry[0], index, matchIndex, a, b, state)\n && state.equals(aEntry[1], bEntry[1], aEntry[0], bEntry[0], a, b, state)) {\n hasMatch = matchedIndices[matchIndex] = 1;\n break;\n }\n matchIndex++;\n }\n if (!hasMatch) {\n return false;\n }\n index++;\n }\n return true;\n}\n/**\n * Whether the objects are equal in value.\n */\nfunction areObjectsEqual(a, b, state) {\n const properties = keys(a);\n let index = properties.length;\n if (keys(b).length !== index) {\n return false;\n }\n // Decrementing `while` showed faster results than either incrementing or\n // decrementing `for` loop and than an incrementing `while` loop. Declarative\n // methods like `some` / `every` were not used to avoid incurring the garbage\n // cost of anonymous callbacks.\n while (index-- > 0) {\n if (!isPropertyEqual(a, b, state, properties[index])) {\n return false;\n }\n }\n return true;\n}\n/**\n * Whether the objects are equal in value with strict property checking.\n */\nfunction areObjectsEqualStrict(a, b, state) {\n const properties = getStrictProperties(a);\n let index = properties.length;\n if (getStrictProperties(b).length !== index) {\n return false;\n }\n let property;\n let descriptorA;\n let descriptorB;\n // Decrementing `while` showed faster results than either incrementing or\n // decrementing `for` loop and than an incrementing `while` loop. Declarative\n // methods like `some` / `every` were not used to avoid incurring the garbage\n // cost of anonymous callbacks.\n while (index-- > 0) {\n property = properties[index];\n if (!isPropertyEqual(a, b, state, property)) {\n return false;\n }\n descriptorA = getOwnPropertyDescriptor(a, property);\n descriptorB = getOwnPropertyDescriptor(b, property);\n if ((descriptorA || descriptorB)\n && (!descriptorA\n || !descriptorB\n || descriptorA.configurable !== descriptorB.configurable\n || descriptorA.enumerable !== descriptorB.enumerable\n || descriptorA.writable !== descriptorB.writable)) {\n return false;\n }\n }\n return true;\n}\n/**\n * Whether the primitive wrappers passed are equal in value.\n */\nfunction arePrimitiveWrappersEqual(a, b) {\n return sameValueEqual(a.valueOf(), b.valueOf());\n}\n/**\n * Whether the regexps passed are equal in value.\n */\nfunction areRegExpsEqual(a, b) {\n return a.source === b.source && a.flags === b.flags;\n}\n/**\n * Whether the `Set`s are equal in value.\n */\nfunction areSetsEqual(a, b, state) {\n const size = a.size;\n if (size !== b.size) {\n return false;\n }\n if (!size) {\n return true;\n }\n const matchedIndices = new Uint8Array(size);\n const aIterable = a.values();\n let aResult;\n let bResult;\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while ((aResult = aIterable.next())) {\n if (aResult.done) {\n break;\n }\n const bIterable = b.values();\n let hasMatch = 0;\n let matchIndex = 0;\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while ((bResult = bIterable.next())) {\n if (bResult.done) {\n break;\n }\n if (!matchedIndices[matchIndex]\n && state.equals(aResult.value, bResult.value, aResult.value, bResult.value, a, b, state)) {\n hasMatch = matchedIndices[matchIndex] = 1;\n break;\n }\n matchIndex++;\n }\n if (!hasMatch) {\n return false;\n }\n }\n return true;\n}\n/**\n * Whether the TypedArray instances are equal in value.\n */\nfunction areTypedArraysEqual(a, b) {\n let index = a.length;\n if (b.length !== index || a.byteOffset !== b.byteOffset) {\n return false;\n }\n while (index-- > 0) {\n if (a[index] !== b[index]) {\n return false;\n }\n }\n return true;\n}\n/**\n * Whether the URL instances are equal in value.\n */\nfunction areUrlsEqual(a, b) {\n return (a.hostname === b.hostname\n && a.pathname === b.pathname\n && a.protocol === b.protocol\n && a.port === b.port\n && a.hash === b.hash\n && a.username === b.username\n && a.password === b.password);\n}\nfunction isPropertyEqual(a, b, state, property) {\n if ((property === REACT_OWNER || property === PREACT_OWNER || property === PREACT_VNODE)\n && (a.$$typeof || b.$$typeof)) {\n return true;\n }\n return hasOwn(b, property) && state.equals(a[property], b[property], property, property, a, b, state);\n}\n\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst toString = Object.prototype.toString;\n/**\n * Create a comparator method based on the type-specific equality comparators passed.\n */\nfunction createEqualityComparator(config) {\n const supportedComparatorMap = createSupportedComparatorMap(config);\n const { areArraysEqual, areDatesEqual, areFunctionsEqual, areMapsEqual, areNumbersEqual, areObjectsEqual, areRegExpsEqual, areSetsEqual, getUnsupportedCustomComparator, } = config;\n /**\n * compare the value of the two objects and return true if they are equivalent in values\n */\n return function comparator(a, b, state) {\n // If the items are strictly equal, no need to do a value comparison.\n if (a === b) {\n return true;\n }\n // If either of the items are nullish and fail the strictly equal check\n // above, then they must be unequal.\n if (a == null || b == null) {\n return false;\n }\n const type = typeof a;\n if (type !== typeof b) {\n return false;\n }\n if (type !== 'object') {\n if (type === 'number' || type === 'bigint') {\n return areNumbersEqual(a, b, state);\n }\n if (type === 'function') {\n return areFunctionsEqual(a, b, state);\n }\n // If a primitive value that is not strictly equal, it must be unequal.\n return false;\n }\n const constructor = a.constructor;\n // Checks are listed in order of commonality of use-case:\n // 1. Common complex object types (plain object, array)\n // 2. Common data values (date, regexp)\n // 3. Less-common complex object types (map, set)\n // 4. Less-common data values (promise, primitive wrappers)\n // Inherently this is both subjective and assumptive, however\n // when reviewing comparable libraries in the wild this order\n // appears to be generally consistent.\n // Constructors should match, otherwise there is potential for false positives\n // between class and subclass or custom object and POJO.\n if (constructor !== b.constructor) {\n return false;\n }\n // Try to fast-path equality checks for other complex object types in the\n // same realm to avoid capturing the string tag. Strict equality is used\n // instead of `instanceof` because it is more performant for the common\n // use-case. If someone is creating a subclass from a native class, it will be\n // handled with the string tag comparison.\n if (constructor === Object) {\n return areObjectsEqual(a, b, state);\n }\n if (constructor === Array) {\n return areArraysEqual(a, b, state);\n }\n if (constructor === Date) {\n return areDatesEqual(a, b, state);\n }\n if (constructor === RegExp) {\n return areRegExpsEqual(a, b, state);\n }\n if (constructor === Map) {\n return areMapsEqual(a, b, state);\n }\n if (constructor === Set) {\n return areSetsEqual(a, b, state);\n }\n if (constructor === Promise) {\n // Avoid tag checks for promise values, since we know if they are not referentially equal\n // then they are not equal.\n return false;\n }\n // `isArray()` works on subclasses and is cross-realm, so we can avoid capturing\n // the string tag or doing an `instanceof` in edge cases.\n if (Array.isArray(a)) {\n return areArraysEqual(a, b, state);\n }\n // Since this is a custom object, capture the string tag to determining its type.\n // This is reasonably performant in modern environments like v8 and SpiderMonkey.\n const tag = toString.call(a);\n const supportedComparator = supportedComparatorMap[tag];\n if (supportedComparator) {\n return supportedComparator(a, b, state);\n }\n const unsupportedCustomComparator = getUnsupportedCustomComparator && getUnsupportedCustomComparator(a, b, state, tag);\n if (unsupportedCustomComparator) {\n return unsupportedCustomComparator(a, b, state);\n }\n // If not matching any tags that require a specific type of comparison, then we hard-code false because\n // the only thing remaining is strict equality, which has already been compared. This is for a few reasons:\n // - Certain types that cannot be introspected (e.g., `WeakMap`). For these types, this is the only\n // comparison that can be made.\n // - For types that can be introspected but do not have an objective definition of what\n // equality is (`Error`, etc.), the subjective decision is to be conservative and strictly compare.\n // In all cases, these decisions should be reevaluated based on changes to the language and\n // common development practices.\n return false;\n };\n}\n/**\n * Create the configuration object used for building comparators.\n */\nfunction createEqualityComparatorConfig({ circular, createCustomConfig, strict, }) {\n let config = {\n areArrayBuffersEqual,\n areArraysEqual: strict ? areObjectsEqualStrict : areArraysEqual,\n areDataViewsEqual,\n areDatesEqual: areDatesEqual,\n areErrorsEqual: areErrorsEqual,\n areFunctionsEqual: strictEqual,\n areMapsEqual: strict ? combineComparators(areMapsEqual, areObjectsEqualStrict) : areMapsEqual,\n areNumbersEqual: sameValueEqual,\n areObjectsEqual: strict ? areObjectsEqualStrict : areObjectsEqual,\n arePrimitiveWrappersEqual: arePrimitiveWrappersEqual,\n areRegExpsEqual: areRegExpsEqual,\n areSetsEqual: strict ? combineComparators(areSetsEqual, areObjectsEqualStrict) : areSetsEqual,\n areTypedArraysEqual: strict\n ? combineComparators(areTypedArraysEqual, areObjectsEqualStrict)\n : areTypedArraysEqual,\n areUrlsEqual: areUrlsEqual,\n getUnsupportedCustomComparator: undefined,\n };\n if (createCustomConfig) {\n config = Object.assign({}, config, createCustomConfig(config));\n }\n if (circular) {\n const areArraysEqual = createIsCircular(config.areArraysEqual);\n const areMapsEqual = createIsCircular(config.areMapsEqual);\n const areObjectsEqual = createIsCircular(config.areObjectsEqual);\n const areSetsEqual = createIsCircular(config.areSetsEqual);\n config = Object.assign({}, config, {\n areArraysEqual,\n areMapsEqual,\n areObjectsEqual,\n areSetsEqual,\n });\n }\n return config;\n}\n/**\n * Default equality comparator pass-through, used as the standard `isEqual` creator for\n * use inside the built comparator.\n */\nfunction createInternalEqualityComparator(compare) {\n return function (a, b, _indexOrKeyA, _indexOrKeyB, _parentA, _parentB, state) {\n return compare(a, b, state);\n };\n}\n/**\n * Create the `isEqual` function used by the consuming application.\n */\nfunction createIsEqual({ circular, comparator, createState, equals, strict }) {\n if (createState) {\n return function isEqual(a, b) {\n const { cache = circular ? new WeakMap() : undefined, meta } = createState();\n return comparator(a, b, {\n cache,\n equals,\n meta,\n strict,\n });\n };\n }\n if (circular) {\n return function isEqual(a, b) {\n return comparator(a, b, {\n cache: new WeakMap(),\n equals,\n meta: undefined,\n strict,\n });\n };\n }\n const state = {\n cache: undefined,\n equals,\n meta: undefined,\n strict,\n };\n return function isEqual(a, b) {\n return comparator(a, b, state);\n };\n}\n/**\n * Create a map of `toString()` values to their respective handlers for `tag`-based lookups.\n */\nfunction createSupportedComparatorMap({ areArrayBuffersEqual, areArraysEqual, areDataViewsEqual, areDatesEqual, areErrorsEqual, areFunctionsEqual, areMapsEqual, areNumbersEqual, areObjectsEqual, arePrimitiveWrappersEqual, areRegExpsEqual, areSetsEqual, areTypedArraysEqual, areUrlsEqual, }) {\n return {\n '[object Arguments]': areObjectsEqual,\n '[object Array]': areArraysEqual,\n '[object ArrayBuffer]': areArrayBuffersEqual,\n '[object AsyncGeneratorFunction]': areFunctionsEqual,\n '[object BigInt]': areNumbersEqual,\n '[object BigInt64Array]': areTypedArraysEqual,\n '[object BigUint64Array]': areTypedArraysEqual,\n '[object Boolean]': arePrimitiveWrappersEqual,\n '[object DataView]': areDataViewsEqual,\n '[object Date]': areDatesEqual,\n // If an error tag, it should be tested explicitly. Like RegExp, the properties are not\n // enumerable, and therefore will give false positives if tested like a standard object.\n '[object Error]': areErrorsEqual,\n '[object Float16Array]': areTypedArraysEqual,\n '[object Float32Array]': areTypedArraysEqual,\n '[object Float64Array]': areTypedArraysEqual,\n '[object Function]': areFunctionsEqual,\n '[object GeneratorFunction]': areFunctionsEqual,\n '[object Int8Array]': areTypedArraysEqual,\n '[object Int16Array]': areTypedArraysEqual,\n '[object Int32Array]': areTypedArraysEqual,\n '[object Map]': areMapsEqual,\n '[object Number]': arePrimitiveWrappersEqual,\n '[object Object]': (a, b, state) => \n // The exception for value comparison is custom `Promise`-like class instances. These should\n // be treated the same as standard `Promise` objects, which means strict equality, and if\n // it reaches this point then that strict equality comparison has already failed.\n typeof a.then !== 'function' && typeof b.then !== 'function' && areObjectsEqual(a, b, state),\n // For RegExp, the properties are not enumerable, and therefore will give false positives if\n // tested like a standard object.\n '[object RegExp]': areRegExpsEqual,\n '[object Set]': areSetsEqual,\n '[object String]': arePrimitiveWrappersEqual,\n '[object URL]': areUrlsEqual,\n '[object Uint8Array]': areTypedArraysEqual,\n '[object Uint8ClampedArray]': areTypedArraysEqual,\n '[object Uint16Array]': areTypedArraysEqual,\n '[object Uint32Array]': areTypedArraysEqual,\n };\n}\n\n/**\n * Whether the items passed are deeply-equal in value.\n */\nconst deepEqual = createCustomEqual();\n/**\n * Whether the items passed are deeply-equal in value based on strict comparison.\n */\nconst strictDeepEqual = createCustomEqual({ strict: true });\n/**\n * Whether the items passed are deeply-equal in value, including circular references.\n */\nconst circularDeepEqual = createCustomEqual({ circular: true });\n/**\n * Whether the items passed are deeply-equal in value, including circular references,\n * based on strict comparison.\n */\nconst strictCircularDeepEqual = createCustomEqual({\n circular: true,\n strict: true,\n});\n/**\n * Whether the items passed are shallowly-equal in value.\n */\nconst shallowEqual = createCustomEqual({\n createInternalComparator: () => sameValueEqual,\n});\n/**\n * Whether the items passed are shallowly-equal in value based on strict comparison\n */\nconst strictShallowEqual = createCustomEqual({\n strict: true,\n createInternalComparator: () => sameValueEqual,\n});\n/**\n * Whether the items passed are shallowly-equal in value, including circular references.\n */\nconst circularShallowEqual = createCustomEqual({\n circular: true,\n createInternalComparator: () => sameValueEqual,\n});\n/**\n * Whether the items passed are shallowly-equal in value, including circular references,\n * based on strict comparison.\n */\nconst strictCircularShallowEqual = createCustomEqual({\n circular: true,\n createInternalComparator: () => sameValueEqual,\n strict: true,\n});\n/**\n * Create a custom equality comparison method.\n *\n * This can be done to create very targeted comparisons in extreme hot-path scenarios\n * where the standard methods are not performant enough, but can also be used to provide\n * support for legacy environments that do not support expected features like\n * `RegExp.prototype.flags` out of the box.\n */\nfunction createCustomEqual(options = {}) {\n const { circular = false, createInternalComparator: createCustomInternalComparator, createState, strict = false, } = options;\n const config = createEqualityComparatorConfig(options);\n const comparator = createEqualityComparator(config);\n const equals = createCustomInternalComparator\n ? createCustomInternalComparator(comparator)\n : createInternalEqualityComparator(comparator);\n return createIsEqual({ circular, comparator, createState, equals, strict });\n}\n\nexport { circularDeepEqual, circularShallowEqual, createCustomEqual, deepEqual, sameValueEqual, sameValueZeroEqual, shallowEqual, strictCircularDeepEqual, strictCircularShallowEqual, strictDeepEqual, strictEqual, strictShallowEqual };\n", "import { createCustomEqual } from 'fast-equals';\n\n/** Implements a deep equals using `fast-equals.createCustomEqual`. Functions\n * are always considered equal, and circular references are tracked to avoid\n * infinite recursion on self-referential inputs.\n *\n * @param a - The first element to compare\n * @param b - The second element to compare\n * @returns - True if the `a` and `b` are deeply equal, false otherwise\n */\nconst deepEquals = createCustomEqual({\n circular: true,\n createCustomConfig: () => ({\n areFunctionsEqual(_a, b) {\n return typeof b === 'function';\n },\n }),\n});\n\nexport default deepEquals;\n", "import UriResolver from 'fast-uri';\nimport jsonpointer from 'jsonpointer';\nimport get from 'lodash/get';\nimport isEmpty from 'lodash/isEmpty';\nimport isObject from 'lodash/isObject';\nimport omit from 'lodash/omit';\n\nimport {\n ALL_OF_KEY,\n ID_KEY,\n JSON_SCHEMA_DRAFT_2019_09,\n JSON_SCHEMA_DRAFT_2020_12,\n REF_KEY,\n SCHEMA_KEY,\n} from './constants';\nimport type { GenericObjectType, RJSFSchema, StrictRJSFSchema } from './types';\n\n/** Looks for the `$id` pointed by `ref` in the schema definitions embedded in\n * a JSON Schema bundle\n *\n * @param schema - The schema wherein `ref` should be searched\n * @param ref - The `$id` of the reference to search for\n * @returns - The schema matching the reference, or `undefined` if no match is found\n */\nfunction findEmbeddedSchemaRecursive<S extends StrictRJSFSchema = RJSFSchema>(schema: S, ref: string): S | undefined {\n if (ID_KEY in schema && UriResolver.equal(schema[ID_KEY] as string, ref)) {\n return schema;\n }\n for (const subSchema of Object.values(schema)) {\n if (Array.isArray(subSchema)) {\n for (const item of subSchema) {\n if (isObject(item)) {\n const result = findEmbeddedSchemaRecursive<S>(item as S, ref);\n if (result !== undefined) {\n return result;\n }\n }\n }\n } else if (isObject(subSchema)) {\n const result = findEmbeddedSchemaRecursive<S>(subSchema as S, ref);\n if (result !== undefined) {\n return result;\n }\n }\n }\n return undefined;\n}\n\n/** Parses a JSONSchema and makes all references absolute with respect to\n * the `baseURI` argument\n * @param schema - The schema to be processed\n * @param baseURI - The base URI to be used for resolving relative references\n */\nexport function makeAllReferencesAbsolute<S extends StrictRJSFSchema = RJSFSchema>(schema: S, baseURI: string): S {\n const currentURI = get(schema, ID_KEY, baseURI);\n let result = schema;\n // Make all other references absolute\n if (REF_KEY in result) {\n result = { ...result, [REF_KEY]: UriResolver.resolve(currentURI, result[REF_KEY]!) };\n }\n // Look for references in nested subschemas\n for (const [key, subSchema] of Object.entries(result)) {\n if (Array.isArray(subSchema)) {\n result = {\n ...result,\n [key]: subSchema.map((item) => (isObject(item) ? makeAllReferencesAbsolute(item as S, currentURI) : item)),\n };\n } else if (isObject(subSchema)) {\n result = { ...result, [key]: makeAllReferencesAbsolute(subSchema as S, currentURI) };\n }\n }\n return result;\n}\n\n/** Splits out the value at the `key` in `object` from the `object`, returning an array that contains in the first\n * location, the `object` minus the `key: value` and in the second location the `value`.\n *\n * @param key - The key from the object to extract\n * @param object - The object from which to extract the element\n * @returns - An array with the first value being the object minus the `key` element and the second element being the\n * value from `object[key]`\n */\nexport function splitKeyElementFromObject(key: string, object: GenericObjectType) {\n const value = object[key];\n const remaining = omit(object, [key]);\n return [remaining, value];\n}\n\n/** Given the name of a `$ref` from within a schema, using the `rootSchema`, recursively look up and return the\n * sub-schema using the path provided by that reference. If `#` is not the first character of the reference, the path\n * does not exist in the schema, or the reference resolves circularly back to itself, then throw an Error.\n * Otherwise return the sub-schema. Also deals with nested `$ref`s in the sub-schema.\n *\n * @param $ref - The ref string for which the schema definition is desired\n * @param [rootSchema={}] - The root schema in which to search for the definition\n * @param recurseList - List of $refs already resolved to prevent recursion\n * @param [baseURI=rootSchema['$id']] - The base URI to be used for resolving relative references\n * @returns - The sub-schema within the `rootSchema` which matches the `$ref` if it exists\n * @throws - Error indicating that no schema for that reference could be resolved\n */\nexport function findSchemaDefinitionRecursive<S extends StrictRJSFSchema = RJSFSchema>(\n $ref?: string,\n rootSchema: S = {} as S,\n recurseList: string[] = [],\n baseURI: string | undefined = get(rootSchema, [ID_KEY]),\n): S {\n const ref = $ref || '';\n let current: S | undefined = undefined;\n let currentBaseURI = baseURI;\n if (ref.startsWith('#')) {\n // Decode URI fragment representation.\n const decodedRef = decodeURIComponent(ref.substring(1));\n if (currentBaseURI === undefined || (ID_KEY in rootSchema && rootSchema[ID_KEY] === currentBaseURI)) {\n current = jsonpointer.get(rootSchema, decodedRef);\n } else if (rootSchema[SCHEMA_KEY] === JSON_SCHEMA_DRAFT_2020_12) {\n current = findEmbeddedSchemaRecursive<S>(rootSchema, currentBaseURI.replace(/\\/$/, ''));\n if (current !== undefined) {\n current = jsonpointer.get(current, decodedRef);\n }\n }\n } else if (rootSchema[SCHEMA_KEY] === JSON_SCHEMA_DRAFT_2020_12) {\n const resolvedRef = currentBaseURI ? UriResolver.resolve(currentBaseURI, ref) : ref;\n const [refId, ...refAnchor] = resolvedRef.replace(/#\\/?$/, '').split('#');\n current = findEmbeddedSchemaRecursive<S>(rootSchema, refId.replace(/\\/$/, ''));\n if (current !== undefined) {\n currentBaseURI = current[ID_KEY];\n if (!isEmpty(refAnchor)) {\n current = jsonpointer.get(current, decodeURIComponent(refAnchor.join('#')));\n }\n }\n }\n if (current === undefined) {\n throw new Error(`Could not find a definition for ${$ref}.`);\n }\n const nextRef = current[REF_KEY];\n if (nextRef) {\n // Check for circular references.\n if (recurseList.includes(nextRef)) {\n if (recurseList.length === 1) {\n throw new Error(`Definition for ${$ref} is a circular reference`);\n }\n const [firstRef, ...restRefs] = recurseList;\n const circularPath = [...restRefs, ref, firstRef].join(' -> ');\n throw new Error(`Definition for ${firstRef} contains a circular reference through ${circularPath}`);\n }\n const [remaining, theRef] = splitKeyElementFromObject(REF_KEY, current);\n const subSchema = findSchemaDefinitionRecursive<S>(theRef, rootSchema, [...recurseList, ref], currentBaseURI);\n if (Object.keys(remaining).length > 0) {\n if (\n rootSchema[SCHEMA_KEY] === JSON_SCHEMA_DRAFT_2019_09 ||\n rootSchema[SCHEMA_KEY] === JSON_SCHEMA_DRAFT_2020_12\n ) {\n return { [ALL_OF_KEY]: [remaining, subSchema] } as S;\n }\n return { ...remaining, ...subSchema };\n }\n return subSchema;\n }\n return current;\n}\n\n/** Given the name of a `$ref` from within a schema, using the `rootSchema`, look up and return the sub-schema using the\n * path provided by that reference. If `#` is not the first character of the reference, the path does not exist in\n * the schema, or the reference resolves circularly back to itself, then throw an Error. Otherwise return the\n * sub-schema. Also deals with nested `$ref`s in the sub-schema.\n *\n * @param $ref - The ref string for which the schema definition is desired\n * @param [rootSchema={}] - The root schema in which to search for the definition\n * @param [baseURI=rootSchema['$id']] - The base URI to be used for resolving relative references\n * @returns - The sub-schema within the `rootSchema` which matches the `$ref` if it exists\n * @throws - Error indicating that no schema for that reference could be resolved\n */\nexport default function findSchemaDefinition<S extends StrictRJSFSchema = RJSFSchema>(\n $ref?: string,\n rootSchema: S = {} as S,\n baseURI: string | undefined = get(rootSchema, [ID_KEY]),\n): S {\n const recurseList: string[] = [];\n return findSchemaDefinitionRecursive($ref, rootSchema, recurseList, baseURI);\n}\n", "/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nexport default isPrototype;\n", "import overArg from './_overArg.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nexport default nativeKeys;\n", "import isPrototype from './_isPrototype.js';\nimport nativeKeys from './_nativeKeys.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeys;\n", "import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nexport default DataView;\n", "import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nexport default Promise;\n", "import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nexport default Set;\n", "import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nexport default WeakMap;\n", "import DataView from './_DataView.js';\nimport Map from './_Map.js';\nimport Promise from './_Promise.js';\nimport Set from './_Set.js';\nimport WeakMap from './_WeakMap.js';\nimport baseGetTag from './_baseGetTag.js';\nimport toSource from './_toSource.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\nexport default getTag;\n", "import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nexport default baseIsArguments;\n", "import baseIsArguments from './_baseIsArguments.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nexport default isArguments;\n", "/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nexport default isLength;\n", "import isFunction from './isFunction.js';\nimport isLength from './isLength.js';\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nexport default isArrayLike;\n", "/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nexport default stubFalse;\n", "import root from './_root.js';\nimport stubFalse from './stubFalse.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nexport default isBuffer;\n", "import baseGetTag from './_baseGetTag.js';\nimport isLength from './isLength.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nexport default baseIsTypedArray;\n", "/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nexport default baseUnary;\n", "import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nexport default nodeUtil;\n", "import baseIsTypedArray from './_baseIsTypedArray.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nexport default isTypedArray;\n", "import baseKeys from './_baseKeys.js';\nimport getTag from './_getTag.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isArrayLike from './isArrayLike.js';\nimport isBuffer from './isBuffer.js';\nimport isPrototype from './_isPrototype.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n setTag = '[object Set]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * jQuery-like collections are considered empty if they have a `length` of `0`.\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\nfunction isEmpty(value) {\n if (value == null) {\n return true;\n }\n if (isArrayLike(value) &&\n (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||\n isBuffer(value) || isTypedArray(value) || isArguments(value))) {\n return !value.length;\n }\n var tag = getTag(value);\n if (tag == mapTag || tag == setTag) {\n return !value.size;\n }\n if (isPrototype(value)) {\n return !baseKeys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n}\n\nexport default isEmpty;\n", "import ListCache from './_ListCache.js';\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nexport default stackClear;\n", "/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nexport default stackDelete;\n", "/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nexport default stackGet;\n", "/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nexport default stackHas;\n", "import ListCache from './_ListCache.js';\nimport Map from './_Map.js';\nimport MapCache from './_MapCache.js';\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nexport default stackSet;\n", "import ListCache from './_ListCache.js';\nimport stackClear from './_stackClear.js';\nimport stackDelete from './_stackDelete.js';\nimport stackGet from './_stackGet.js';\nimport stackHas from './_stackHas.js';\nimport stackSet from './_stackSet.js';\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nexport default Stack;\n", "/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nexport default arrayEach;\n", "import getNative from './_getNative.js';\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nexport default defineProperty;\n", "import defineProperty from './_defineProperty.js';\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nexport default baseAssignValue;\n", "import baseAssignValue from './_baseAssignValue.js';\nimport eq from './eq.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nexport default assignValue;\n", "import assignValue from './_assignValue.js';\nimport baseAssignValue from './_baseAssignValue.js';\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\nexport default copyObject;\n", "/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nexport default baseTimes;\n", "/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nexport default isIndex;\n", "import baseTimes from './_baseTimes.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isIndex from './_isIndex.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default arrayLikeKeys;\n", "import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeys from './_baseKeys.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nexport default keys;\n", "import copyObject from './_copyObject.js';\nimport keys from './keys.js';\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\nexport default baseAssign;\n", "/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default nativeKeysIn;\n", "import isObject from './isObject.js';\nimport isPrototype from './_isPrototype.js';\nimport nativeKeysIn from './_nativeKeysIn.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeysIn;\n", "import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeysIn from './_baseKeysIn.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nexport default keysIn;\n", "import copyObject from './_copyObject.js';\nimport keysIn from './keysIn.js';\n\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n}\n\nexport default baseAssignIn;\n", "import root from './_root.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\nexport default cloneBuffer;\n", "/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nexport default copyArray;\n", "/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nexport default arrayFilter;\n", "/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\nexport default stubArray;\n", "import arrayFilter from './_arrayFilter.js';\nimport stubArray from './stubArray.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\nexport default getSymbols;\n", "import copyObject from './_copyObject.js';\nimport getSymbols from './_getSymbols.js';\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\nexport default copySymbols;\n", "/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nexport default arrayPush;\n", "import arrayPush from './_arrayPush.js';\nimport getPrototype from './_getPrototype.js';\nimport getSymbols from './_getSymbols.js';\nimport stubArray from './stubArray.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n};\n\nexport default getSymbolsIn;\n", "import copyObject from './_copyObject.js';\nimport getSymbolsIn from './_getSymbolsIn.js';\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n}\n\nexport default copySymbolsIn;\n", "import arrayPush from './_arrayPush.js';\nimport isArray from './isArray.js';\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nexport default baseGetAllKeys;\n", "import baseGetAllKeys from './_baseGetAllKeys.js';\nimport getSymbols from './_getSymbols.js';\nimport keys from './keys.js';\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nexport default getAllKeys;\n", "import baseGetAllKeys from './_baseGetAllKeys.js';\nimport getSymbolsIn from './_getSymbolsIn.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n}\n\nexport default getAllKeysIn;\n", "/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\nexport default initCloneArray;\n", "import root from './_root.js';\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nexport default Uint8Array;\n", "import Uint8Array from './_Uint8Array.js';\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\nexport default cloneArrayBuffer;\n", "import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nexport default cloneDataView;\n", "/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\nexport default cloneRegExp;\n", "import Symbol from './_Symbol.js';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nexport default cloneSymbol;\n", "import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nexport default cloneTypedArray;\n", "import cloneArrayBuffer from './_cloneArrayBuffer.js';\nimport cloneDataView from './_cloneDataView.js';\nimport cloneRegExp from './_cloneRegExp.js';\nimport cloneSymbol from './_cloneSymbol.js';\nimport cloneTypedArray from './_cloneTypedArray.js';\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\nexport default initCloneByTag;\n", "import isObject from './isObject.js';\n\n/** Built-in value references. */\nvar objectCreate = Object.create;\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\nexport default baseCreate;\n", "import baseCreate from './_baseCreate.js';\nimport getPrototype from './_getPrototype.js';\nimport isPrototype from './_isPrototype.js';\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\nexport default initCloneObject;\n", "import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]';\n\n/**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\nfunction baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n}\n\nexport default baseIsMap;\n", "import baseIsMap from './_baseIsMap.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsMap = nodeUtil && nodeUtil.isMap;\n\n/**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\nvar isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\nexport default isMap;\n", "import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar setTag = '[object Set]';\n\n/**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\nfunction baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n}\n\nexport default baseIsSet;\n", "import baseIsSet from './_baseIsSet.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsSet = nodeUtil && nodeUtil.isSet;\n\n/**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\nvar isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\nexport default isSet;\n", "import Stack from './_Stack.js';\nimport arrayEach from './_arrayEach.js';\nimport assignValue from './_assignValue.js';\nimport baseAssign from './_baseAssign.js';\nimport baseAssignIn from './_baseAssignIn.js';\nimport cloneBuffer from './_cloneBuffer.js';\nimport copyArray from './_copyArray.js';\nimport copySymbols from './_copySymbols.js';\nimport copySymbolsIn from './_copySymbolsIn.js';\nimport getAllKeys from './_getAllKeys.js';\nimport getAllKeysIn from './_getAllKeysIn.js';\nimport getTag from './_getTag.js';\nimport initCloneArray from './_initCloneArray.js';\nimport initCloneByTag from './_initCloneByTag.js';\nimport initCloneObject from './_initCloneObject.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isMap from './isMap.js';\nimport isObject from './isObject.js';\nimport isSet from './isSet.js';\nimport keys from './keys.js';\nimport keysIn from './keysIn.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n}\n\nexport default baseClone;\n", "/**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\nfunction last(array) {\n var length = array == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n}\n\nexport default last;\n", "/**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n}\n\nexport default baseSlice;\n", "import baseGet from './_baseGet.js';\nimport baseSlice from './_baseSlice.js';\n\n/**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\nfunction parent(object, path) {\n return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));\n}\n\nexport default parent;\n", "import castPath from './_castPath.js';\nimport last from './last.js';\nimport parent from './_parent.js';\nimport toKey from './_toKey.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.unset`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The property path to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n */\nfunction baseUnset(object, path) {\n path = castPath(path, object);\n\n // Prevent prototype pollution:\n // https://github.com/lodash/lodash/security/advisories/GHSA-xxjr-mmjv-4gpg\n // https://github.com/lodash/lodash/security/advisories/GHSA-f23m-r3pf-42rh\n var index = -1,\n length = path.length;\n\n if (!length) {\n return true;\n }\n\n while (++index < length) {\n var key = toKey(path[index]);\n\n // Always block \"__proto__\" anywhere in the path if it's not expected\n if (key === '__proto__' && !hasOwnProperty.call(object, '__proto__')) {\n return false;\n }\n\n // Block constructor/prototype as non-terminal traversal keys to prevent\n // escaping the object graph into built-in constructors and prototypes.\n if ((key === 'constructor' || key === 'prototype') && index < length - 1) {\n return false;\n }\n }\n\n var obj = parent(object, path);\n return obj == null || delete obj[toKey(last(path))];\n}\n\nexport default baseUnset;\n", "import isPlainObject from './isPlainObject.js';\n\n/**\n * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain\n * objects.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {string} key The key of the property to inspect.\n * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.\n */\nfunction customOmitClone(value) {\n return isPlainObject(value) ? undefined : value;\n}\n\nexport default customOmitClone;\n", "import Symbol from './_Symbol.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\n\n/** Built-in value references. */\nvar spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;\n\n/**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\nfunction isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n}\n\nexport default isFlattenable;\n", "import arrayPush from './_arrayPush.js';\nimport isFlattenable from './_isFlattenable.js';\n\n/**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\nfunction baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n}\n\nexport default baseFlatten;\n", "import baseFlatten from './_baseFlatten.js';\n\n/**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\nfunction flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n}\n\nexport default flatten;\n", "/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\nexport default apply;\n", "import apply from './_apply.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nexport default overRest;\n", "/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nexport default constant;\n", "/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nexport default identity;\n", "import constant from './constant.js';\nimport defineProperty from './_defineProperty.js';\nimport identity from './identity.js';\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\nexport default baseSetToString;\n", "/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\nexport default shortOut;\n", "import baseSetToString from './_baseSetToString.js';\nimport shortOut from './_shortOut.js';\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\nexport default setToString;\n", "import flatten from './flatten.js';\nimport overRest from './_overRest.js';\nimport setToString from './_setToString.js';\n\n/**\n * A specialized version of `baseRest` which flattens the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\nfunction flatRest(func) {\n return setToString(overRest(func, undefined, flatten), func + '');\n}\n\nexport default flatRest;\n", "import arrayMap from './_arrayMap.js';\nimport baseClone from './_baseClone.js';\nimport baseUnset from './_baseUnset.js';\nimport castPath from './_castPath.js';\nimport copyObject from './_copyObject.js';\nimport customOmitClone from './_customOmitClone.js';\nimport flatRest from './_flatRest.js';\nimport getAllKeysIn from './_getAllKeysIn.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable property paths of `object` that are not omitted.\n *\n * **Note:** This method is considerably slower than `_.pick`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to omit.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omit(object, ['a', 'c']);\n * // => { 'b': '2' }\n */\nvar omit = flatRest(function(object, paths) {\n var result = {};\n if (object == null) {\n return result;\n }\n var isDeep = false;\n paths = arrayMap(paths, function(path) {\n path = castPath(path, object);\n isDeep || (isDeep = path.length > 1);\n return path;\n });\n copyObject(object, getAllKeysIn(object), result);\n if (isDeep) {\n result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);\n }\n var length = paths.length;\n while (length--) {\n baseUnset(result, paths[length]);\n }\n return result;\n});\n\nexport default omit;\n", "/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHas(object, key) {\n return object != null && hasOwnProperty.call(object, key);\n}\n\nexport default baseHas;\n", "import castPath from './_castPath.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isIndex from './_isIndex.js';\nimport isLength from './isLength.js';\nimport toKey from './_toKey.js';\n\n/**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\nfunction hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n}\n\nexport default hasPath;\n", "import baseHas from './_baseHas.js';\nimport hasPath from './_hasPath.js';\n\n/**\n * Checks if `path` is a direct property of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = { 'a': { 'b': 2 } };\n * var other = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b');\n * // => true\n *\n * _.has(object, ['a', 'b']);\n * // => true\n *\n * _.has(other, 'a');\n * // => false\n */\nfunction has(object, path) {\n return object != null && hasPath(object, path, baseHas);\n}\n\nexport default has;\n", "import baseGetTag from './_baseGetTag.js';\nimport isArray from './isArray.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar stringTag = '[object String]';\n\n/**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\nfunction isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);\n}\n\nexport default isString;\n", "import get from 'lodash/get';\nimport isString from 'lodash/isString';\n\nimport { DISCRIMINATOR_PATH } from './constants';\nimport type { RJSFSchema, StrictRJSFSchema } from './types';\n\n/** Returns the `discriminator.propertyName` when defined in the `schema` if it is a string. A warning is generated when\n * it is not a string. Returns `undefined` when a valid discriminator is not present.\n *\n * @param schema - The schema from which the discriminator is potentially obtained\n * @returns - The `discriminator.propertyName` if it exists in the schema, otherwise `undefined`\n */\nexport default function getDiscriminatorFieldFromSchema<S extends StrictRJSFSchema = RJSFSchema>(schema: S) {\n let discriminator: string | undefined;\n const maybeString = get(schema, DISCRIMINATOR_PATH);\n if (isString(maybeString)) {\n discriminator = maybeString;\n } else if (maybeString !== undefined) {\n // oxlint-disable-next-line no-console\n console.warn(`Expecting discriminator to be a string, got \"${typeof maybeString}\" instead`);\n }\n return discriminator;\n}\n", "import baseFlatten from './_baseFlatten.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Recursively flattens `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flattenDeep([1, [2, [3, [4]], 5]]);\n * // => [1, 2, 3, 4, 5]\n */\nfunction flattenDeep(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, INFINITY) : [];\n}\n\nexport default flattenDeep;\n", "import baseAssignValue from './_baseAssignValue.js';\nimport eq from './eq.js';\n\n/**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nexport default assignMergeValue;\n", "/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nexport default createBaseFor;\n", "import createBaseFor from './_createBaseFor.js';\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nexport default baseFor;\n", "import isArrayLike from './isArrayLike.js';\nimport isObjectLike from './isObjectLike.js';\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\nexport default isArrayLikeObject;\n", "/**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n}\n\nexport default safeGet;\n", "import copyObject from './_copyObject.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return copyObject(value, keysIn(value));\n}\n\nexport default toPlainObject;\n", "import assignMergeValue from './_assignMergeValue.js';\nimport cloneBuffer from './_cloneBuffer.js';\nimport cloneTypedArray from './_cloneTypedArray.js';\nimport copyArray from './_copyArray.js';\nimport initCloneObject from './_initCloneObject.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isArrayLikeObject from './isArrayLikeObject.js';\nimport isBuffer from './isBuffer.js';\nimport isFunction from './isFunction.js';\nimport isObject from './isObject.js';\nimport isPlainObject from './isPlainObject.js';\nimport isTypedArray from './isTypedArray.js';\nimport safeGet from './_safeGet.js';\nimport toPlainObject from './toPlainObject.js';\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n}\n\nexport default baseMergeDeep;\n", "import Stack from './_Stack.js';\nimport assignMergeValue from './_assignMergeValue.js';\nimport baseFor from './_baseFor.js';\nimport baseMergeDeep from './_baseMergeDeep.js';\nimport isObject from './isObject.js';\nimport keysIn from './keysIn.js';\nimport safeGet from './_safeGet.js';\n\n/**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n}\n\nexport default baseMerge;\n", "import identity from './identity.js';\nimport overRest from './_overRest.js';\nimport setToString from './_setToString.js';\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\nexport default baseRest;\n", "import eq from './eq.js';\nimport isArrayLike from './isArrayLike.js';\nimport isIndex from './_isIndex.js';\nimport isObject from './isObject.js';\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\nexport default isIterateeCall;\n", "import baseRest from './_baseRest.js';\nimport isIterateeCall from './_isIterateeCall.js';\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\nexport default createAssigner;\n", "import baseMerge from './_baseMerge.js';\nimport createAssigner from './_createAssigner.js';\n\n/**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\nvar merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n});\n\nexport default merge;\n", "import assignValue from './_assignValue.js';\nimport castPath from './_castPath.js';\nimport isIndex from './_isIndex.js';\nimport isObject from './isObject.js';\nimport toKey from './_toKey.js';\n\n/**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\nfunction baseSet(object, path, value, customizer) {\n if (!isObject(object)) {\n return object;\n }\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = toKey(path[index]),\n newValue = value;\n\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return object;\n }\n\n if (index != lastIndex) {\n var objValue = nested[key];\n newValue = customizer ? customizer(objValue, key, nested) : undefined;\n if (newValue === undefined) {\n newValue = isObject(objValue)\n ? objValue\n : (isIndex(path[index + 1]) ? [] : {});\n }\n }\n assignValue(nested, key, newValue);\n nested = nested[key];\n }\n return object;\n}\n\nexport default baseSet;\n", "import baseSet from './_baseSet.js';\n\n/**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\nfunction set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n}\n\nexport default set;\n", "import identity from './identity.js';\n\n/**\n * Casts `value` to `identity` if it's not a function.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Function} Returns cast function.\n */\nfunction castFunction(value) {\n return typeof value == 'function' ? value : identity;\n}\n\nexport default castFunction;\n", "/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nexport default trimmedEndIndex;\n", "import trimmedEndIndex from './_trimmedEndIndex.js';\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nexport default baseTrim;\n", "import baseTrim from './_baseTrim.js';\nimport isObject from './isObject.js';\nimport isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nexport default toNumber;\n", "import toNumber from './toNumber.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0,\n MAX_INTEGER = 1.7976931348623157e+308;\n\n/**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\nfunction toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n return value === value ? value : 0;\n}\n\nexport default toFinite;\n", "import toFinite from './toFinite.js';\n\n/**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\nfunction toInteger(value) {\n var result = toFinite(value),\n remainder = result % 1;\n\n return result === result ? (remainder ? result - remainder : result) : 0;\n}\n\nexport default toInteger;\n", "import baseTimes from './_baseTimes.js';\nimport castFunction from './_castFunction.js';\nimport toInteger from './toInteger.js';\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used as references for the maximum length and index of an array. */\nvar MAX_ARRAY_LENGTH = 4294967295;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMin = Math.min;\n\n/**\n * Invokes the iteratee `n` times, returning an array of the results of\n * each invocation. The iteratee is invoked with one argument; (index).\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n * @example\n *\n * _.times(3, String);\n * // => ['0', '1', '2']\n *\n * _.times(4, _.constant(0));\n * // => [0, 0, 0, 0]\n */\nfunction times(n, iteratee) {\n n = toInteger(n);\n if (n < 1 || n > MAX_SAFE_INTEGER) {\n return [];\n }\n var index = MAX_ARRAY_LENGTH,\n length = nativeMin(n, MAX_ARRAY_LENGTH);\n\n iteratee = castFunction(iteratee);\n n -= MAX_ARRAY_LENGTH;\n\n var result = baseTimes(length, iteratee);\n while (++index < n) {\n iteratee(index);\n }\n return result;\n}\n\nexport default times;\n", "import baseFor from './_baseFor.js';\nimport keys from './keys.js';\n\n/**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n}\n\nexport default baseForOwn;\n", "/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\nexport default setCacheAdd;\n", "/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {boolean} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\nexport default setCacheHas;\n", "import MapCache from './_MapCache.js';\nimport setCacheAdd from './_setCacheAdd.js';\nimport setCacheHas from './_setCacheHas.js';\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\nexport default SetCache;\n", "/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\nexport default arraySome;\n", "/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\nexport default cacheHas;\n", "import SetCache from './_SetCache.js';\nimport arraySome from './_arraySome.js';\nimport cacheHas from './_cacheHas.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\nexport default equalArrays;\n", "/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\nexport default mapToArray;\n", "/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\nexport default setToArray;\n", "import Symbol from './_Symbol.js';\nimport Uint8Array from './_Uint8Array.js';\nimport eq from './eq.js';\nimport equalArrays from './_equalArrays.js';\nimport mapToArray from './_mapToArray.js';\nimport setToArray from './_setToArray.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\nexport default equalByTag;\n", "import getAllKeys from './_getAllKeys.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\nexport default equalObjects;\n", "import Stack from './_Stack.js';\nimport equalArrays from './_equalArrays.js';\nimport equalByTag from './_equalByTag.js';\nimport equalObjects from './_equalObjects.js';\nimport getTag from './_getTag.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nexport default baseIsEqualDeep;\n", "import baseIsEqualDeep from './_baseIsEqualDeep.js';\nimport isObjectLike from './isObjectLike.js';\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\nexport default baseIsEqual;\n", "import Stack from './_Stack.js';\nimport baseIsEqual from './_baseIsEqual.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\nfunction baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n}\n\nexport default baseIsMatch;\n", "import isObject from './isObject.js';\n\n/**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\nfunction isStrictComparable(value) {\n return value === value && !isObject(value);\n}\n\nexport default isStrictComparable;\n", "import isStrictComparable from './_isStrictComparable.js';\nimport keys from './keys.js';\n\n/**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\nfunction getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n}\n\nexport default getMatchData;\n", "/**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n}\n\nexport default matchesStrictComparable;\n", "import baseIsMatch from './_baseIsMatch.js';\nimport getMatchData from './_getMatchData.js';\nimport matchesStrictComparable from './_matchesStrictComparable.js';\n\n/**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n}\n\nexport default baseMatches;\n", "/**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHasIn(object, key) {\n return object != null && key in Object(object);\n}\n\nexport default baseHasIn;\n", "import baseHasIn from './_baseHasIn.js';\nimport hasPath from './_hasPath.js';\n\n/**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\nfunction hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n}\n\nexport default hasIn;\n", "import baseIsEqual from './_baseIsEqual.js';\nimport get from './get.js';\nimport hasIn from './hasIn.js';\nimport isKey from './_isKey.js';\nimport isStrictComparable from './_isStrictComparable.js';\nimport matchesStrictComparable from './_matchesStrictComparable.js';\nimport toKey from './_toKey.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n}\n\nexport default baseMatchesProperty;\n", "/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n}\n\nexport default baseProperty;\n", "import baseGet from './_baseGet.js';\n\n/**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n}\n\nexport default basePropertyDeep;\n", "import baseProperty from './_baseProperty.js';\nimport basePropertyDeep from './_basePropertyDeep.js';\nimport isKey from './_isKey.js';\nimport toKey from './_toKey.js';\n\n/**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': 2 } },\n * { 'a': { 'b': 1 } }\n * ];\n *\n * _.map(objects, _.property('a.b'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');\n * // => [1, 2]\n */\nfunction property(path) {\n return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);\n}\n\nexport default property;\n", "import baseMatches from './_baseMatches.js';\nimport baseMatchesProperty from './_baseMatchesProperty.js';\nimport identity from './identity.js';\nimport isArray from './isArray.js';\nimport property from './property.js';\n\n/**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\nfunction baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n}\n\nexport default baseIteratee;\n", "import arrayEach from './_arrayEach.js';\nimport baseCreate from './_baseCreate.js';\nimport baseForOwn from './_baseForOwn.js';\nimport baseIteratee from './_baseIteratee.js';\nimport getPrototype from './_getPrototype.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isFunction from './isFunction.js';\nimport isObject from './isObject.js';\nimport isTypedArray from './isTypedArray.js';\n\n/**\n * An alternative to `_.reduce`; this method transforms `object` to a new\n * `accumulator` object which is the result of running each of its own\n * enumerable string keyed properties thru `iteratee`, with each invocation\n * potentially mutating the `accumulator` object. If `accumulator` is not\n * provided, a new object with the same `[[Prototype]]` will be used. The\n * iteratee is invoked with four arguments: (accumulator, value, key, object).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The custom accumulator value.\n * @returns {*} Returns the accumulated value.\n * @example\n *\n * _.transform([2, 3, 4], function(result, n) {\n * result.push(n *= n);\n * return n % 2 == 0;\n * }, []);\n * // => [4, 9]\n *\n * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] }\n */\nfunction transform(object, iteratee, accumulator) {\n var isArr = isArray(object),\n isArrLike = isArr || isBuffer(object) || isTypedArray(object);\n\n iteratee = baseIteratee(iteratee, 4);\n if (accumulator == null) {\n var Ctor = object && object.constructor;\n if (isArrLike) {\n accumulator = isArr ? new Ctor : [];\n }\n else if (isObject(object)) {\n accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};\n }\n else {\n accumulator = {};\n }\n }\n (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {\n return iteratee(accumulator, value, index, object);\n });\n return accumulator;\n}\n\nexport default transform;\n", "/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n}\n\nexport default baseFindIndex;\n", "/**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\nfunction baseIsNaN(value) {\n return value !== value;\n}\n\nexport default baseIsNaN;\n", "/**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n}\n\nexport default strictIndexOf;\n", "import baseFindIndex from './_baseFindIndex.js';\nimport baseIsNaN from './_baseIsNaN.js';\nimport strictIndexOf from './_strictIndexOf.js';\n\n/**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n}\n\nexport default baseIndexOf;\n", "import baseIndexOf from './_baseIndexOf.js';\n\n/**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n}\n\nexport default arrayIncludes;\n", "/**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n}\n\nexport default arrayIncludesWith;\n", "/**\n * This method returns `undefined`.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Util\n * @example\n *\n * _.times(2, _.noop);\n * // => [undefined, undefined]\n */\nfunction noop() {\n // No operation performed.\n}\n\nexport default noop;\n", "import Set from './_Set.js';\nimport noop from './noop.js';\nimport setToArray from './_setToArray.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\nvar createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n};\n\nexport default createSet;\n", "import SetCache from './_SetCache.js';\nimport arrayIncludes from './_arrayIncludes.js';\nimport arrayIncludesWith from './_arrayIncludesWith.js';\nimport cacheHas from './_cacheHas.js';\nimport createSet from './_createSet.js';\nimport setToArray from './_setToArray.js';\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\nfunction baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n}\n\nexport default baseUniq;\n", "import baseUniq from './_baseUniq.js';\n\n/**\n * Creates a duplicate-free version of an array, using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons, in which only the first occurrence of each element\n * is kept. The order of result values is determined by the order they occur\n * in the array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniq([2, 1, 2]);\n * // => [2, 1]\n */\nfunction uniq(array) {\n return (array && array.length) ? baseUniq(array) : [];\n}\n\nexport default uniq;\n", "/** Given a specific `value` attempts to guess the type of a schema element. In the case where we have to implicitly\n * create a schema, it is useful to know what type to use based on the data we are defining.\n *\n * @param value - The value from which to guess the type\n * @returns - The best guess for the object type\n */\nexport default function guessType(value: any) {\n if (Array.isArray(value)) {\n return 'array';\n }\n if (typeof value === 'string') {\n return 'string';\n }\n if (value == null) {\n return 'null';\n }\n if (typeof value === 'boolean') {\n return 'boolean';\n }\n if (typeof value === 'number' && !Number.isNaN(value)) {\n return 'number';\n }\n if (typeof value === 'object') {\n return 'object';\n }\n // Default to string if we can't figure it out\n return 'string';\n}\n", "import baseFlatten from './_baseFlatten.js';\nimport baseRest from './_baseRest.js';\nimport baseUniq from './_baseUniq.js';\nimport isArrayLikeObject from './isArrayLikeObject.js';\n\n/**\n * Creates an array of unique values, in order, from all given arrays using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.union([2], [1, 2]);\n * // => [2, 1]\n */\nvar union = baseRest(function(arrays) {\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));\n});\n\nexport default union;\n", "import guessType from './guessType';\nimport type { RJSFSchema, StrictRJSFSchema } from './types';\n\n/** Gets the type of a given `schema`. If the type is not explicitly defined, then an attempt is made to infer it from\n * other elements of the schema as follows:\n * - schema.const: Returns the `guessType()` of that value\n * - schema.enum: Returns `string`\n * - schema.properties: Returns `object`\n * - schema.additionalProperties: Returns `object`\n * - schema.patternProperties: Returns `object`\n * - type is an array with a length of 2 and one type is 'null': Returns the other type\n *\n * @param schema - The schema for which to get the type\n * @returns - The type of the schema\n */\nexport default function getSchemaType<S extends StrictRJSFSchema = RJSFSchema>(\n schema: S,\n): string | string[] | undefined {\n let { type } = schema;\n\n if (!type && schema.const) {\n return guessType(schema.const);\n }\n\n if (!type && schema.enum) {\n return 'string';\n }\n\n if (!type && (schema.properties || schema.additionalProperties || schema.patternProperties)) {\n return 'object';\n }\n\n if (Array.isArray(type)) {\n if (type.length === 2 && type.includes('null')) {\n type = type.find((t) => t !== 'null');\n } else {\n // oxlint-disable-next-line prefer-destructuring\n type = type[0];\n }\n }\n\n return type;\n}\n", "import union from 'lodash/union';\n\nimport { REQUIRED_KEY } from './constants';\nimport getSchemaType from './getSchemaType';\nimport isObject from './isObject';\nimport type { GenericObjectType, GenericSymbolObjectType } from './types';\n\n/** Recursively merge deeply nested schemas. The difference between `mergeSchemas` and `mergeObjects` is that\n * `mergeSchemas` only concats arrays for values under the 'required' keyword, and when it does, it doesn't include\n * duplicate values.\n *\n * @param obj1 - The first schema object to merge\n * @param obj2 - The second schema object to merge\n * @returns - The merged schema object\n */\nexport default function mergeSchemas(obj1: GenericObjectType, obj2: GenericObjectType) {\n const acc = { ...obj1 }; // Prevent mutation of source object.\n const result = Object.keys(obj2).reduce((accumulator, key) => {\n const left = obj1 ? obj1[key] : {},\n right = obj2[key];\n if (obj1 && key in obj1 && isObject(right)) {\n accumulator[key] = mergeSchemas(left, right);\n } else if (\n obj1 &&\n obj2 &&\n (getSchemaType(obj1) === 'object' || getSchemaType(obj2) === 'object') &&\n key === REQUIRED_KEY &&\n Array.isArray(left) &&\n Array.isArray(right)\n ) {\n // Don't include duplicate values when merging 'required' fields.\n accumulator[key] = union(left, right);\n } else {\n accumulator[key] = right;\n }\n return accumulator;\n }, acc);\n // Copy own Symbol-keyed properties from obj2 (Object.keys skips them).\n for (const sym of Object.getOwnPropertySymbols(obj2)) {\n // To avoid issues with symbols, we cast them to GenericSymbolObjectType. If we make the mergeSchema function take\n // in GenericSymbolObjectType rather than GenericObjectType, it causes a bunch of type errors downstream\n (result as GenericSymbolObjectType)[sym] = (obj2 as GenericSymbolObjectType)[sym];\n }\n return result;\n}\n", "import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar numberTag = '[object Number]';\n\n/**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are\n * classified as numbers, use the `_.isFinite` method.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a number, else `false`.\n * @example\n *\n * _.isNumber(3);\n * // => true\n *\n * _.isNumber(Number.MIN_VALUE);\n * // => true\n *\n * _.isNumber(Infinity);\n * // => true\n *\n * _.isNumber('3');\n * // => false\n */\nfunction isNumber(value) {\n return typeof value == 'number' ||\n (isObjectLike(value) && baseGetTag(value) == numberTag);\n}\n\nexport default isNumber;\n", "import get from 'lodash/get';\n\nimport { PROPERTIES_KEY } from './constants';\nimport type { RJSFSchema, StrictRJSFSchema } from './types';\n\n/** Compares the value of `discriminatorField` within `formData` against the value of `discriminatorField` within schema for each `option`.\n * Returns index of first `option` whose discriminator matches formData. Returns `undefined` if there is no match.\n * This function does not work with discriminators of `\"type\": \"object\"` and `\"type\": \"array\"`\n *\n * @param formData - The current formData, if any, used to figure out a match\n * @param options - The list of options to find a matching options from\n * @param [discriminatorField] - The optional name of the field within the options object whose value is used to\n * determine which option is selected\n * @returns - The index of the matched option or undefined if there is no match\n */\nexport default function getOptionMatchingSimpleDiscriminator<T = any, S extends StrictRJSFSchema = RJSFSchema>(\n formData: T | undefined,\n options: S[],\n discriminatorField?: string,\n): number | undefined {\n if (formData && discriminatorField) {\n const value = get(formData, discriminatorField);\n\n if (value === undefined) {\n return undefined;\n }\n\n for (let i = 0; i < options.length; i += 1) {\n const option = options[i];\n const discriminator: S = get(option, [PROPERTIES_KEY, discriminatorField], {}) as S;\n\n if (discriminator.type !== 'object' && discriminator.type !== 'array') {\n if (discriminator.const === value) {\n return i;\n }\n if (discriminator.enum?.includes(value)) {\n return i;\n }\n }\n }\n }\n return undefined;\n}\n", "import get from 'lodash/get';\nimport has from 'lodash/has';\nimport isNumber from 'lodash/isNumber';\n\nimport { PROPERTIES_KEY } from '../constants';\nimport getOptionMatchingSimpleDiscriminator from '../getOptionMatchingSimpleDiscriminator';\nimport type { FormContextType, RJSFSchema, StrictRJSFSchema, ValidatorType } from '../types';\n\n/** Given the `formData` and list of `options`, attempts to find the index of the first option that matches the data.\n * Always returns the first option if there is nothing that matches.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be used when necessary\n * @param formData - The current formData, if any, used to figure out a match\n * @param options - The list of options to find a matching options from\n * @param rootSchema - The root schema, used to primarily to look up `$ref`s\n * @param [discriminatorField] - The optional name of the field within the options object whose value is used to\n * determine which option is selected\n * @returns - The index of the first matched option or 0 if none is available\n */\nexport default function getFirstMatchingOption<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n validator: ValidatorType<T, S, F>,\n formData: T | undefined,\n options: S[],\n rootSchema: S,\n discriminatorField?: string,\n): number {\n // For performance, skip validating subschemas if formData is undefined. We just\n // want to get the first option in that case.\n if (formData === undefined) {\n return 0;\n }\n\n const simpleDiscriminatorMatch = getOptionMatchingSimpleDiscriminator(formData, options, discriminatorField);\n if (isNumber(simpleDiscriminatorMatch)) {\n return simpleDiscriminatorMatch;\n }\n\n for (let i = 0; i < options.length; i += 1) {\n const option = options[i];\n\n // If we have a discriminator field, then we will use this to make the determination\n if (discriminatorField && has(option, [PROPERTIES_KEY, discriminatorField])) {\n const value = get(formData, discriminatorField);\n const discriminator: S = get(option, [PROPERTIES_KEY, discriminatorField], {}) as S;\n if (validator.isValid(discriminator, value, rootSchema)) {\n return i;\n }\n } else if (option[PROPERTIES_KEY]) {\n // If the schema describes an object then we need to add slightly more\n // strict matching to the schema, because unless the schema uses the\n // \"requires\" keyword, an object will match the schema as long as it\n // doesn't have matching keys with a conflicting type. To do this we use an\n // \"anyOf\" with an array of requires. This augmentation expresses that the\n // schema should match if any of the keys in the schema are present on the\n // object and pass validation.\n //\n // Create an \"anyOf\" schema that requires at least one of the keys in the\n // \"properties\" object\n const requiresAnyOf = {\n anyOf: Object.keys(option[PROPERTIES_KEY]).map((key) => ({\n required: [key],\n })),\n };\n\n let augmentedSchema;\n\n // If the \"anyOf\" keyword already exists, wrap the augmentation in an \"allOf\"\n if (option.anyOf) {\n // Create a shallow clone of the option\n const { ...shallowClone } = option;\n\n if (!shallowClone.allOf) {\n shallowClone.allOf = [];\n } else {\n // If \"allOf\" already exists, shallow clone the array\n shallowClone.allOf = shallowClone.allOf.slice();\n }\n\n shallowClone.allOf.push(requiresAnyOf);\n\n augmentedSchema = shallowClone;\n } else {\n augmentedSchema = { ...option, ...requiresAnyOf };\n }\n\n // Remove the \"required\" field as it's likely that not all fields have\n // been filled in yet, which will mean that the schema is not valid\n delete augmentedSchema.required;\n\n if (validator.isValid(augmentedSchema, formData, rootSchema)) {\n return i;\n }\n } else if (validator.isValid(option, formData, rootSchema)) {\n return i;\n }\n }\n return 0;\n}\n", null, null, null, null, null, null, null, null, null, null, null, "import { createComparator, createMerger, createShallowAllOfMerge } from '@x0k/json-schema-merge';\nimport { createDeduplicator, createIntersector } from '@x0k/json-schema-merge/lib/array';\n\nconst { compareSchemaDefinitions, compareSchemaValues } = createComparator();\nconst { mergeArrayOfSchemaDefinitions } = createMerger({\n intersectJson: createIntersector(compareSchemaValues),\n deduplicateJsonSchemaDef: createDeduplicator(compareSchemaDefinitions),\n});\n\n/** Shared `@x0k/json-schema-merge` shallow-allOf merge function used by `retrieveSchema` and\n * `omitExtraData`. Constructed once from a single comparator/merger/intersector/deduplicator\n * pipeline so both consumers share the same configuration without duplicating setup code.\n *\n * Usage: pass a schema that contains an `allOf` keyword and receive the merged result.\n *\n * @example\n * const merged = shallowAllOfMerge(schema); // schema.allOf is merged into the parent schema\n */\nexport default createShallowAllOfMerge(mergeArrayOfSchemaDefinitions);\n", "import flattenDeep from 'lodash/flattenDeep';\nimport get from 'lodash/get';\nimport isEmpty from 'lodash/isEmpty';\nimport merge from 'lodash/merge';\nimport set from 'lodash/set';\nimport times from 'lodash/times';\nimport transform from 'lodash/transform';\nimport uniq from 'lodash/uniq';\n\nimport {\n ADDITIONAL_PROPERTIES_KEY,\n ADDITIONAL_PROPERTY_FLAG,\n ALL_OF_KEY,\n ANY_OF_KEY,\n DEPENDENCIES_KEY,\n ID_KEY,\n IF_KEY,\n ITEMS_KEY,\n ONE_OF_KEY,\n PATTERN_PROPERTIES_KEY,\n PROPERTIES_KEY,\n REF_KEY,\n RJSF_REF_CYCLE_KEY,\n RJSF_REF_KEY,\n} from '../constants';\nimport deepEquals from '../deepEquals';\nimport findSchemaDefinition, { splitKeyElementFromObject } from '../findSchemaDefinition';\nimport getDiscriminatorFieldFromSchema from '../getDiscriminatorFieldFromSchema';\nimport guessType from '../guessType';\nimport isObject from '../isObject';\nimport mergeSchemas from '../mergeSchemas';\nimport type {\n Experimental_CustomMergeAllOf,\n FormContextType,\n GenericObjectType,\n RJSFMarkedSchema,\n RJSFSchema,\n StrictRJSFSchema,\n ValidatorType,\n} from '../types';\nimport getFirstMatchingOption from './getFirstMatchingOption';\nimport shallowAllOfMerge from './shallowAllOfMerge';\n\n/** Retrieves an expanded schema that has had all of its conditions, additional properties, references and dependencies\n * resolved and merged into the `schema` given a `validator`, `rootSchema` and `rawFormData` that is used to do the\n * potentially recursive resolution.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs\n * @param schema - The schema for which retrieving a schema is desired\n * @param [rootSchema={}] - The root schema that will be forwarded to all the APIs\n * @param [rawFormData] - The current formData, if any, to assist retrieving a schema\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @param [resolveAnyOfOrOneOfRefs = false] - Optional flag indicating whether to resolved refs in anyOf/oneOf lists\n * @returns - The schema having its conditions, additional properties, references and dependencies resolved\n */\nexport default function retrieveSchema<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n validator: ValidatorType<T, S, F>,\n schema: S,\n rootSchema: S = {} as S,\n rawFormData?: T,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n resolveAnyOfOrOneOfRefs = false,\n): S {\n return retrieveSchemaInternal<T, S, F>(\n validator,\n schema,\n rootSchema,\n rawFormData,\n undefined,\n undefined,\n experimental_customMergeAllOf,\n resolveAnyOfOrOneOfRefs,\n )[0];\n}\n\n/** Converts boolean schemas to equivalent object schemas for APIs that operate on `StrictRJSFSchema` objects.\n *\n * @param schema - The schema or boolean schema to normalize\n * @returns - The original schema or an equivalent object schema\n */\nfunction normalizeBooleanSchema<S extends StrictRJSFSchema = RJSFSchema>(schema: S | boolean): S {\n if (typeof schema !== 'boolean') {\n return schema;\n }\n return (schema ? {} : { not: {} }) as S;\n}\n\n/** Resolves a conditional block (if/else/then) by removing the condition and merging the appropriate conditional branch\n * with the rest of the schema. If `expandAllBranches` is true, then the `retrieveSchemaInteral()` results for both\n * conditions will be returned.\n *\n * @param validator - An implementation of the `ValidatorType` interface that is used to detect valid schema conditions\n * @param schema - The schema for which resolving a condition is desired\n * @param rootSchema - The root schema that will be forwarded to all the APIs\n * @param expandAllBranches - Flag, if true, will return all possible branches of conditions, any/oneOf and\n * dependencies as a list of schemas\n * @param recurseList - The list of recursive references already processed\n * @param [formData] - The current formData to assist retrieving a schema\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - A list of schemas with the appropriate conditions resolved, possibly with all branches expanded\n */\nexport function resolveCondition<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n validator: ValidatorType<T, S, F>,\n schema: S,\n rootSchema: S,\n expandAllBranches: boolean,\n recurseList: string[],\n formData?: T,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): S[] {\n const { if: expression, then, else: otherwise, ...resolvedSchemaLessConditional } = schema;\n\n const conditionValue = validator.isValid(expression as S, formData || ({} as T), rootSchema);\n let resolvedSchemas = [resolvedSchemaLessConditional as S];\n let schemas: S[] = [];\n if (expandAllBranches) {\n if (then && typeof then !== 'boolean') {\n const thenSchema = then as unknown as S;\n schemas = schemas.concat(\n retrieveSchemaInternal<T, S, F>(\n validator,\n thenSchema,\n rootSchema,\n formData,\n expandAllBranches,\n recurseList,\n experimental_customMergeAllOf,\n ),\n );\n }\n if (otherwise && typeof otherwise !== 'boolean') {\n const otherwiseSchema = otherwise as unknown as S;\n schemas = schemas.concat(\n retrieveSchemaInternal<T, S, F>(\n validator,\n otherwiseSchema,\n rootSchema,\n formData,\n expandAllBranches,\n recurseList,\n experimental_customMergeAllOf,\n ),\n );\n }\n } else {\n const conditionalBranch = (conditionValue ? then : otherwise) as S | boolean | undefined;\n if (conditionalBranch !== undefined) {\n const conditionalSchema = normalizeBooleanSchema<S>(conditionalBranch);\n schemas = schemas.concat(\n retrieveSchemaInternal<T, S, F>(\n validator,\n conditionalSchema,\n rootSchema,\n formData,\n expandAllBranches,\n recurseList,\n experimental_customMergeAllOf,\n ),\n );\n }\n }\n if (schemas.length) {\n resolvedSchemas = schemas.map((s) => mergeSchemas(resolvedSchemaLessConditional, s) as S);\n }\n return resolvedSchemas.flatMap((s) =>\n retrieveSchemaInternal<T, S, F>(\n validator,\n s,\n rootSchema,\n formData,\n expandAllBranches,\n recurseList,\n experimental_customMergeAllOf,\n ),\n );\n}\n\n/** Given a list of lists of allOf, anyOf or oneOf values, create a list of lists of all permutations of the values. The\n * `listOfLists` is expected to be all resolved values of the 1st...nth schemas within an `allOf`, `anyOf` or `oneOf`.\n * From those lists, build a matrix for each `xxxOf` where there is more than one schema for a row in the list of lists.\n *\n * For example:\n * - If there are three xxxOf rows (A, B, C) and they have been resolved such that there is only one A, two B and three\n * C schemas then:\n * - The permutation for the first row is `[[A]]`\n * - The permutations for the second row are `[[A,B1], [A,B2]]`\n * - The permutations for the third row are `[[A,B1,C1], [A,B1,C2], [A,B1,C3], [A,B2,C1], [A,B2,C2], [A,B2,C3]]`\n *\n * @param listOfLists - The list of lists of elements that represent the allOf, anyOf or oneOf resolved values in order\n * @returns - The list of all permutations of schemas for a set of `xxxOf`s\n */\nexport function getAllPermutationsOfXxxOf<S extends StrictRJSFSchema = RJSFSchema>(listOfLists: S[][]) {\n const allPermutations: S[][] = listOfLists.reduce<S[][]>(\n (permutations, list) => {\n // When there are more than one set of schemas for a row, duplicate the set of permutations and add in the values\n if (list.length > 1) {\n return list.flatMap((element) => times(permutations.length, (i) => [...permutations[i]].concat(element)));\n }\n // Otherwise just push in the single value into the current set of permutations\n permutations.forEach((permutation) => permutation.push(list[0]));\n return permutations;\n },\n [[]], // Start with an empty list\n );\n\n return allPermutations;\n}\n\n/** Returns the subset of 'patternProperties' specifications that match the given 'key'\n *\n * @param schema - The schema whose 'patternProperties' are to be filtered\n * @param key - The key to match against the 'patternProperties' specifications\n * @returns - The subset of 'patternProperties' specifications that match the given 'key'\n */\nexport function getMatchingPatternProperties<S extends StrictRJSFSchema = RJSFSchema>(\n schema: S,\n key: string,\n): Required<S['patternProperties']> {\n return Object.keys(schema.patternProperties!)\n .filter((pattern: string) => RegExp(pattern).test(key))\n .reduce(\n (obj, pattern) => {\n // Pass the pattern using the `[]` index notation so that any `.` in the pattern are not used as a dotted path\n set(obj, [pattern], schema.patternProperties![pattern]);\n return obj;\n },\n {} as Required<S['patternProperties']>,\n );\n}\n\n/** Resolves references and dependencies within a schema and its 'allOf' children. Passes the `expandAllBranches` flag\n * down to the `retrieveSchemaInternal()`, `resolveReference()` and `resolveDependencies()` helper calls. If\n * `expandAllBranches` is true, then all possible dependencies and/or allOf branches are returned.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs\n * @param schema - The schema for which resolving a schema is desired\n * @param rootSchema - The root schema that will be forwarded to all the APIs\n * @param expandAllBranches - Flag, if true, will return all possible branches of conditions, any/oneOf and dependencies\n * as a list of schemas\n * @param recurseList - The list of recursive references already processed\n * @param [formData] - The current formData, if any, to assist retrieving a schema\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @param [resolveAnyOfOrOneOfRefs] - Optional flag indicating whether to resolved refs in anyOf/oneOf lists\n * @returns - The list of schemas having its references, dependencies and allOf schemas resolved\n */\nexport function resolveSchema<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n validator: ValidatorType<T, S, F>,\n schema: S,\n rootSchema: S,\n expandAllBranches: boolean,\n recurseList: string[],\n formData?: T,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n resolveAnyOfOrOneOfRefs?: boolean,\n): S[] {\n const updatedSchemas = resolveReference<T, S, F>(\n validator,\n schema,\n rootSchema,\n expandAllBranches,\n recurseList,\n formData,\n experimental_customMergeAllOf,\n resolveAnyOfOrOneOfRefs,\n );\n if (updatedSchemas.length > 1 || updatedSchemas[0] !== schema) {\n // return the updatedSchemas array if it has either multiple schemas within it\n // OR the first schema is not the same as the original schema\n return updatedSchemas;\n }\n if (DEPENDENCIES_KEY in schema) {\n const resolvedSchemas = resolveDependencies<T, S, F>(\n validator,\n schema,\n rootSchema,\n expandAllBranches,\n recurseList,\n formData,\n experimental_customMergeAllOf,\n );\n return resolvedSchemas.flatMap((s) =>\n retrieveSchemaInternal<T, S, F>(\n validator,\n s,\n rootSchema,\n formData,\n expandAllBranches,\n recurseList,\n experimental_customMergeAllOf,\n ),\n );\n }\n if (ALL_OF_KEY in schema && Array.isArray(schema[ALL_OF_KEY])) {\n const allOfSchemaElements: S[][] = schema.allOf.map((allOfSubschema) =>\n retrieveSchemaInternal<T, S, F>(\n validator,\n allOfSubschema as S,\n rootSchema,\n formData,\n expandAllBranches,\n recurseList,\n experimental_customMergeAllOf,\n ),\n );\n const allPermutations = getAllPermutationsOfXxxOf<S>(allOfSchemaElements);\n return allPermutations.map((permutation) => ({\n ...schema,\n allOf: permutation,\n }));\n }\n // No $ref or dependencies or allOf attribute was found, returning the original schema.\n return [schema];\n}\n\n/** Resolves all references within a schema and then returns the `retrieveSchemaInternal()` if the resolved schema is\n * actually different than the original. Passes the `expandAllBranches` flag down to the `retrieveSchemaInternal()`\n * helper call.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs\n * @param schema - The schema for which resolving a reference is desired\n * @param rootSchema - The root schema that will be forwarded to all the APIs\n * @param expandAllBranches - Flag, if true, will return all possible branches of conditions, any/oneOf and dependencies\n * as a list of schemas\n * @param recurseList - The list of recursive references already processed\n * @param [formData] - The current formData, if any, to assist retrieving a schema\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @param [resolveAnyOfOrOneOfRefs] - Optional flag indicating whether to resolved refs in anyOf/oneOf lists\n * @returns - The list schemas retrieved after having all references resolved\n */\nexport function resolveReference<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n validator: ValidatorType<T, S, F>,\n schema: S,\n rootSchema: S,\n expandAllBranches: boolean,\n recurseList: string[],\n formData?: T,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n resolveAnyOfOrOneOfRefs?: boolean,\n): S[] {\n const updatedSchema = resolveAllReferences<S>(schema, rootSchema, recurseList, undefined, resolveAnyOfOrOneOfRefs);\n if (updatedSchema !== schema) {\n // Only call this if the schema was actually changed by the `resolveAllReferences()` function\n return retrieveSchemaInternal<T, S, F>(\n validator,\n updatedSchema,\n rootSchema,\n formData,\n expandAllBranches,\n recurseList,\n experimental_customMergeAllOf,\n resolveAnyOfOrOneOfRefs,\n );\n }\n return [schema];\n}\n\n/** Resolves all references within the schema itself as well as any of its properties and array items.\n *\n * @param schema - The schema for which resolving all references is desired\n * @param rootSchema - The root schema that will be forwarded to all the APIs\n * @param recurseList - List of $refs already resolved to prevent recursion\n * @param [baseURI] - The base URI to be used for resolving relative references\n * @param [resolveAnyOfOrOneOfRefs] - Optional flag indicating whether to resolved refs in anyOf/oneOf lists\n * @param [markCycleOnDetection=false] - When true and a recursive $ref is detected, the returned schema is tagged\n * with `__rjsf_ref_cycle: true` so that `SchemaField` can render a cycle indicator instead of recursing.\n * Should only be `true` when called from an **object-property** context, because object properties are always\n * rendered (creating an infinite loop), whereas array items and anyOf/oneOf branches are data-driven.\n * @returns - given schema will all references resolved or the original schema if no internal `$refs` were resolved\n */\nexport function resolveAllReferences<S extends StrictRJSFSchema = RJSFSchema>(\n schema: S,\n rootSchema: S,\n recurseList: string[],\n baseURI?: string,\n resolveAnyOfOrOneOfRefs?: boolean,\n markCycleOnDetection = false,\n): S {\n if (!isObject(schema)) {\n return schema;\n }\n let resolvedSchema: S = schema;\n let currentBaseURI = baseURI;\n // resolve top level ref\n if (REF_KEY in resolvedSchema) {\n const { $ref, ...localSchema } = resolvedSchema;\n // Check for a recursive reference and stop the loop\n if (recurseList.includes($ref!)) {\n return markCycleOnDetection ? ({ ...resolvedSchema, [RJSF_REF_CYCLE_KEY]: true } as S) : resolvedSchema;\n }\n recurseList.push($ref!);\n // Retrieve the referenced schema definition.\n const refSchema = findSchemaDefinition<S>($ref, rootSchema, currentBaseURI);\n resolvedSchema = { ...refSchema, ...localSchema, [RJSF_REF_KEY]: $ref };\n if (ID_KEY in resolvedSchema) {\n currentBaseURI = resolvedSchema[ID_KEY];\n }\n }\n\n if (PROPERTIES_KEY in resolvedSchema) {\n const childrenLists: string[][] = [];\n const updatedProps = transform(\n resolvedSchema[PROPERTIES_KEY]!,\n (acc, value, key: string) => {\n const childList: string[] = [...recurseList];\n // Mark cycles only when NOT in resolveAnyOfOrOneOfRefs mode. When resolveAnyOfOrOneOfRefs=true\n // (e.g. from ObjectField), options are resolved against a shared recurseList that accumulates\n // refs across branches, causing false positives. In simple (non-anyOf) resolution, a $ref cycle\n // in an object property always causes an infinite render loop and must be caught.\n acc[key] = resolveAllReferences(\n value as S,\n rootSchema,\n childList,\n currentBaseURI,\n resolveAnyOfOrOneOfRefs,\n !resolveAnyOfOrOneOfRefs,\n );\n childrenLists.push(childList);\n },\n {} as RJSFSchema,\n );\n merge(recurseList, uniq(flattenDeep(childrenLists)));\n resolvedSchema = { ...resolvedSchema, [PROPERTIES_KEY]: updatedProps };\n }\n\n if (\n ITEMS_KEY in resolvedSchema &&\n !Array.isArray(resolvedSchema.items) &&\n typeof resolvedSchema.items !== 'boolean'\n ) {\n resolvedSchema = {\n ...resolvedSchema,\n // Array items are only rendered when data exists, so a $ref cycle here does NOT cause an infinite render.\n items: resolveAllReferences(\n resolvedSchema.items as S,\n rootSchema,\n recurseList,\n currentBaseURI,\n resolveAnyOfOrOneOfRefs,\n ),\n };\n }\n\n if (resolveAnyOfOrOneOfRefs) {\n let key: 'anyOf' | 'oneOf' | undefined;\n let schemas: S[] | undefined;\n if (ANY_OF_KEY in schema && Array.isArray(schema[ANY_OF_KEY])) {\n key = ANY_OF_KEY;\n schemas = resolvedSchema[ANY_OF_KEY] as S[];\n } else if (ONE_OF_KEY in schema && Array.isArray(schema[ONE_OF_KEY])) {\n key = ONE_OF_KEY;\n schemas = resolvedSchema[ONE_OF_KEY] as S[];\n }\n if (key && schemas) {\n resolvedSchema = {\n ...resolvedSchema,\n [key]: schemas.map((s: S) =>\n resolveAllReferences(s, rootSchema, recurseList, currentBaseURI, resolveAnyOfOrOneOfRefs),\n ),\n };\n }\n }\n\n return deepEquals(schema, resolvedSchema) ? schema : resolvedSchema;\n}\n\n/** Creates new 'properties' items for each key in the `formData`\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be used when necessary\n * @param theSchema - The schema for which the existing additional properties is desired\n * @param [rootSchema] - The root schema, used to primarily to look up `$ref`s * @param validator\n * @param [aFormData] - The current formData, if any, to assist retrieving a schema\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - The updated schema with additional properties stubbed\n */\nexport function stubExistingAdditionalProperties<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n validator: ValidatorType<T, S, F>,\n theSchema: S,\n rootSchema?: S,\n aFormData?: T,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): S {\n // Clone the schema so that we don't ruin the consumer's original\n const schema = {\n ...theSchema,\n properties: { ...theSchema.properties },\n };\n\n // make sure formData is an object\n const formData: GenericObjectType = aFormData && isObject(aFormData) ? aFormData : {};\n Object.keys(formData).forEach((key) => {\n if (key in schema.properties) {\n // No need to stub, our schema already has the property\n return;\n }\n if (PATTERN_PROPERTIES_KEY in schema) {\n const matchingProperties = getMatchingPatternProperties(schema, key);\n if (!isEmpty(matchingProperties)) {\n schema.properties[key] = retrieveSchema<T, S, F>(\n validator,\n { [ALL_OF_KEY]: Object.values(matchingProperties) } as S,\n rootSchema,\n get(formData, [key]) as T,\n experimental_customMergeAllOf,\n );\n (schema.properties[key] as RJSFMarkedSchema)[ADDITIONAL_PROPERTY_FLAG] = true;\n return;\n }\n }\n if (ADDITIONAL_PROPERTIES_KEY in schema && schema.additionalProperties !== false) {\n let additionalProperties: S['additionalProperties'];\n if (typeof schema.additionalProperties !== 'boolean') {\n if (REF_KEY in schema.additionalProperties!) {\n additionalProperties = retrieveSchema<T, S, F>(\n validator,\n { [REF_KEY]: get(schema.additionalProperties, [REF_KEY]) } as S,\n rootSchema,\n get(formData, [key]) as T,\n experimental_customMergeAllOf,\n );\n } else if ('type' in schema.additionalProperties!) {\n additionalProperties = { ...schema.additionalProperties };\n } else if (ANY_OF_KEY in schema.additionalProperties! || ONE_OF_KEY in schema.additionalProperties!) {\n additionalProperties = {\n type: 'object',\n ...schema.additionalProperties,\n };\n } else {\n additionalProperties = { type: guessType(get(formData, [key])) };\n }\n } else {\n additionalProperties = { type: guessType(get(formData, [key])) };\n }\n\n // The type of our new key should match the additionalProperties value;\n schema.properties[key] = additionalProperties;\n // Set our additional property flag so we know it was dynamically added\n (schema.properties[key] as RJSFMarkedSchema)[ADDITIONAL_PROPERTY_FLAG] = true;\n } else {\n // Invalid property\n schema.properties[key] = { type: 'null' };\n // Set our additional property flag so we know it was dynamically added\n (schema.properties[key] as RJSFMarkedSchema)[ADDITIONAL_PROPERTY_FLAG] = true;\n }\n });\n\n return schema;\n}\n\n/**\n * Internal helper that merges allOf schemas using @x0k/json-schema-merge's shallow allOf merge\n * @param schema - The schema containing an `allOf` keyword\n * @returns The schema with allOf schemas merged\n */\nfunction mergeAllOf<S extends StrictRJSFSchema = RJSFSchema>(schema: S): S {\n return shallowAllOfMerge(schema) as S;\n}\n\n/** Internal handler that retrieves an expanded schema that has had all of its conditions, additional properties,\n * references and dependencies resolved and merged into the `schema` given a `validator`, `rootSchema` and `rawFormData`\n * that is used to do the potentially recursive resolution. If `expandAllBranches` is true, then all possible branches\n * of the schema and its references, conditions and dependencies are returned.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs\n * @param schema - The schema for which retrieving a schema is desired\n * @param rootSchema - The root schema that will be forwarded to all the APIs\n * @param [rawFormData] - The current formData, if any, to assist retrieving a schema\n * @param [expandAllBranches=false] - Flag, if true, will return all possible branches of conditions, any/oneOf and\n * dependencies as a list of schemas\n * @param [recurseList=[]] - The optional, list of recursive references already processed\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @param [resolveAnyOfOrOneOfRefs] - Optional flag indicating whether to resolved refs in anyOf/oneOf lists\n * @returns - The schema(s) resulting from having its conditions, additional properties, references and dependencies\n * resolved. Multiple schemas may be returned if `expandAllBranches` is true.\n */\nexport function retrieveSchemaInternal<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n validator: ValidatorType<T, S, F>,\n schema: S,\n rootSchema: S,\n rawFormData?: T,\n expandAllBranches = false,\n recurseList: string[] = [],\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n resolveAnyOfOrOneOfRefs?: boolean,\n): S[] {\n if (!isObject(schema)) {\n return [{} as S];\n }\n const resolvedSchemas = resolveSchema<T, S, F>(\n validator,\n schema,\n rootSchema,\n expandAllBranches,\n recurseList,\n rawFormData,\n experimental_customMergeAllOf,\n resolveAnyOfOrOneOfRefs,\n );\n return resolvedSchemas.flatMap((s: S) => {\n let resolvedSchema = s;\n if (IF_KEY in resolvedSchema) {\n return resolveCondition<T, S, F>(\n validator,\n resolvedSchema,\n rootSchema,\n expandAllBranches,\n recurseList,\n rawFormData as T,\n experimental_customMergeAllOf,\n );\n }\n if (ALL_OF_KEY in resolvedSchema) {\n // resolve allOf schemas\n if (expandAllBranches) {\n const { allOf, ...restOfSchema } = resolvedSchema;\n return [...(allOf as S[]), restOfSchema as S];\n }\n try {\n const withContainsSchemas = [] as S[];\n const withoutContainsSchemas = [] as S[];\n // Collect Symbol-keyed properties from allOf subschemas before merging; shallowAllOfMerge\n // (external library) only operates on string keys and will drop them.\n const allOfSymbols: Record<symbol, unknown> = {};\n resolvedSchema.allOf?.forEach((allOfItem) => {\n if (typeof allOfItem === 'object' && allOfItem.contains) {\n withContainsSchemas.push(allOfItem as S);\n } else {\n withoutContainsSchemas.push(allOfItem as S);\n for (const sym of Object.getOwnPropertySymbols(allOfItem)) {\n if (!(sym in allOfSymbols)) {\n allOfSymbols[sym] = (allOfItem as any)[sym];\n }\n }\n }\n });\n if (withContainsSchemas.length) {\n resolvedSchema = { ...resolvedSchema, allOf: withoutContainsSchemas };\n }\n resolvedSchema = experimental_customMergeAllOf\n ? experimental_customMergeAllOf(resolvedSchema)\n : mergeAllOf(resolvedSchema);\n // Re-apply collected Symbol properties that the merge dropped.\n for (const sym of Object.getOwnPropertySymbols(allOfSymbols)) {\n (resolvedSchema as any)[sym] = allOfSymbols[sym];\n }\n if (withContainsSchemas.length) {\n resolvedSchema.allOf = withContainsSchemas;\n }\n } catch (e) {\n // oxlint-disable-next-line no-console\n console.warn('could not merge subschemas in allOf:\\n', e);\n const { allOf, ...resolvedSchemaWithoutAllOf } = resolvedSchema;\n return resolvedSchemaWithoutAllOf as S;\n }\n }\n if (PROPERTIES_KEY in resolvedSchema && PATTERN_PROPERTIES_KEY in resolvedSchema) {\n resolvedSchema = Object.keys(resolvedSchema.properties!).reduce(\n (acc, key) => {\n const matchingProperties = getMatchingPatternProperties(acc, key);\n if (!isEmpty(matchingProperties)) {\n acc.properties[key] = retrieveSchema<T, S, F>(\n validator,\n { allOf: [acc.properties[key], ...Object.values(matchingProperties)] } as S,\n rootSchema,\n get(rawFormData, [key]) as T,\n experimental_customMergeAllOf,\n );\n }\n return acc;\n },\n {\n ...resolvedSchema,\n properties: { ...resolvedSchema.properties },\n },\n );\n }\n const hasAdditionalProperties =\n PATTERN_PROPERTIES_KEY in resolvedSchema ||\n (ADDITIONAL_PROPERTIES_KEY in resolvedSchema && resolvedSchema.additionalProperties !== false);\n if (hasAdditionalProperties) {\n return stubExistingAdditionalProperties<T, S, F>(\n validator,\n resolvedSchema,\n rootSchema,\n rawFormData as T,\n experimental_customMergeAllOf,\n );\n }\n\n return resolvedSchema;\n });\n}\n\n/** Resolves an `anyOf` or `oneOf` within a schema (if present) to the list of schemas returned from\n * `retrieveSchemaInternal()` for the best matching option. If `expandAllBranches` is true, then a list of schemas for ALL\n * options are retrieved and returned.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs\n * @param schema - The schema for which retrieving a schema is desired\n * @param rootSchema - The root schema that will be forwarded to all the APIs\n * @param expandAllBranches - Flag, if true, will return all possible branches of conditions, any/oneOf and dependencies\n * as a list of schemas\n * @param [rawFormData] - The current formData, if any, to assist retrieving a schema, defaults to an empty object\n * @returns - Either an array containing the best matching option or all options if `expandAllBranches` is true\n */\nexport function resolveAnyOrOneOfSchemas<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(validator: ValidatorType<T, S, F>, schema: S, rootSchema: S, expandAllBranches: boolean, rawFormData?: T) {\n let anyOrOneOf: S[] | undefined;\n const { oneOf, anyOf, ...remaining } = schema;\n if (Array.isArray(oneOf)) {\n anyOrOneOf = oneOf as S[];\n } else if (Array.isArray(anyOf)) {\n anyOrOneOf = anyOf as S[];\n }\n if (anyOrOneOf) {\n // Ensure that during expand all branches we pass an object rather than undefined so that all options are interrogated\n const formData = rawFormData === undefined && expandAllBranches ? ({} as T) : rawFormData;\n const discriminator = getDiscriminatorFieldFromSchema<S>(schema);\n anyOrOneOf = anyOrOneOf.map((s) => resolveAllReferences(s, rootSchema, []));\n // Call this to trigger the set of isValid() calls that the schema parser will need\n const option = getFirstMatchingOption<T, S, F>(validator, formData, anyOrOneOf, rootSchema, discriminator);\n if (expandAllBranches) {\n // Also trigger isValid() for the relaxed variants so that precompiled validators capture their hashes.\n // omitExtraData's handleOneOf relaxes additionalProperties:false → true before scoring; those mutated\n // schemas must be present in a precompiled validator's compiled set or isValid() will throw at runtime.\n // Using getFirstMatchingOption (rather than calling isValid directly) ensures that the augmented forms\n // of each option (as constructed internally by getFirstMatchingOption for options with properties) are\n // also captured. The return value is discarded — the call is purely for ParserValidator's side effect.\n const relaxed = relaxOptionsForScoring<S>(anyOrOneOf, false, rootSchema);\n getFirstMatchingOption<T, S, F>(validator, formData, relaxed, rootSchema, discriminator);\n return anyOrOneOf.map((item) => mergeSchemas(remaining, item) as S);\n }\n return [mergeSchemas(remaining, anyOrOneOf[option]) as S];\n }\n return [schema];\n}\n\n/** Normalises a list of `oneOf`/`anyOf` options for use in option-scoring only (not for filtering).\n * Boolean schemas are converted to their object equivalents (`true` → `{}`, `false` → `{not:{}}`).\n * When `resolveRefs` is `true`, each object option is first passed through `resolveAllReferences`\n * so that `$ref`-based options expose their `additionalProperties` constraint before relaxation.\n * Any option whose `additionalProperties` is `false` is widened to `true` so that\n * `getClosestMatchingOption` / `validator.isValid()` does not produce false negatives when the\n * form data contains keys not listed in `properties`.\n *\n * @param options - The raw `oneOf`/`anyOf` array, which may contain boolean schemas\n * @param [resolveRefs=false] - When `true`, resolve `$ref`s in each option before relaxing; pass\n * `rootSchema` as well. Set `false` (default) when refs are already resolved at the call site.\n * @param [rootSchema] - Required when `resolveRefs` is `true`; the root schema used to look up `$ref`s\n * @returns - A new array of plain schema objects with `additionalProperties` relaxed where needed\n */\nexport function relaxOptionsForScoring<S extends StrictRJSFSchema = RJSFSchema>(\n options: (S | boolean)[],\n resolveRefs = false,\n rootSchema?: S,\n): S[] {\n return options.map((d) => {\n if (!isObject(d)) {\n return normalizeBooleanSchema<S>(d);\n }\n const schema = resolveRefs && rootSchema ? resolveAllReferences<S>(d, rootSchema, []) : d;\n return schema.additionalProperties === false ? { ...schema, additionalProperties: true } : schema;\n });\n}\n\n/** Resolves dependencies within a schema and its 'anyOf/oneOf' children. Passes the `expandAllBranches` flag down to\n * the `resolveAnyOrOneOfSchema()` and `processDependencies()` helper calls.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs\n * @param schema - The schema for which resolving a dependency is desired\n * @param rootSchema - The root schema that will be forwarded to all the APIs\n * @param expandAllBranches - Flag, if true, will return all possible branches of conditions, any/oneOf and dependencies\n * as a list of schemas\n * @param recurseList - The list of recursive references already processed\n * @param [formData] - The current formData, if any, to assist retrieving a schema\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - The list of schemas with their dependencies resolved\n */\nexport function resolveDependencies<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n validator: ValidatorType<T, S, F>,\n schema: S,\n rootSchema: S,\n expandAllBranches: boolean,\n recurseList: string[],\n formData?: T,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): S[] {\n // Drop the dependencies from the source schema.\n const { dependencies, ...remainingSchema } = schema;\n const resolvedSchemas = resolveAnyOrOneOfSchemas<T, S, F>(\n validator,\n remainingSchema as S,\n rootSchema,\n expandAllBranches,\n formData,\n );\n return resolvedSchemas.flatMap((resolvedSchema) =>\n processDependencies<T, S, F>(\n validator,\n dependencies,\n resolvedSchema,\n rootSchema,\n expandAllBranches,\n recurseList,\n formData,\n experimental_customMergeAllOf,\n ),\n );\n}\n\n/** Processes all the `dependencies` recursively into the list of `resolvedSchema`s as needed. Passes the\n * `expandAllBranches` flag down to the `withDependentSchema()` and the recursive `processDependencies()` helper calls.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs\n * @param dependencies - The set of dependencies that needs to be processed\n * @param resolvedSchema - The schema for which processing dependencies is desired\n * @param rootSchema - The root schema that will be forwarded to all the APIs\n * @param expandAllBranches - Flag, if true, will return all possible branches of conditions, any/oneOf and dependencies\n * as a list of schemas\n * @param recurseList - The list of recursive references already processed\n * @param [formData] - The current formData, if any, to assist retrieving a schema\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - The schema with the `dependencies` resolved into it\n */\nexport function processDependencies<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n validator: ValidatorType<T, S, F>,\n dependencies: S['dependencies'],\n resolvedSchema: S,\n rootSchema: S,\n expandAllBranches: boolean,\n recurseList: string[],\n formData?: T,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): S[] {\n let schemas = [resolvedSchema];\n // Process dependencies updating the local schema properties as appropriate.\n for (const dependencyKey in dependencies) {\n if (\n (expandAllBranches || get(formData, [dependencyKey]) !== undefined) &&\n (!resolvedSchema.properties || dependencyKey in resolvedSchema.properties)\n ) {\n const [remainingDependencies, dependencyValue] = splitKeyElementFromObject(\n dependencyKey,\n dependencies as GenericObjectType,\n );\n if (Array.isArray(dependencyValue)) {\n schemas[0] = withDependentProperties<S>(resolvedSchema, dependencyValue);\n } else if (isObject(dependencyValue)) {\n schemas = withDependentSchema<T, S, F>(\n validator,\n resolvedSchema,\n rootSchema,\n dependencyKey,\n dependencyValue as S,\n expandAllBranches,\n recurseList,\n formData,\n experimental_customMergeAllOf,\n );\n }\n return schemas.flatMap((schema) =>\n processDependencies<T, S, F>(\n validator,\n remainingDependencies,\n schema,\n rootSchema,\n expandAllBranches,\n recurseList,\n formData,\n experimental_customMergeAllOf,\n ),\n );\n }\n }\n return schemas;\n}\n\n/** Updates a schema with additionally required properties added\n *\n * @param schema - The schema for which resolving a dependent properties is desired\n * @param [additionallyRequired] - An optional array of additionally required names\n * @returns - The schema with the additional required values merged in\n */\nexport function withDependentProperties<S extends StrictRJSFSchema = RJSFSchema>(\n schema: S,\n additionallyRequired?: string[],\n) {\n if (!additionallyRequired) {\n return schema;\n }\n const required = Array.isArray(schema.required)\n ? Array.from(new Set([...schema.required, ...additionallyRequired]))\n : additionallyRequired;\n return { ...schema, required };\n}\n\n/** Merges a dependent schema into the `schema` dealing with oneOfs and references. Passes the `expandAllBranches` flag\n * down to the `retrieveSchemaInternal()`, `resolveReference()` and `withExactlyOneSubschema()` helper calls.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs\n * @param schema - The schema for which resolving a dependent schema is desired\n * @param rootSchema - The root schema that will be forwarded to all the APIs\n * @param dependencyKey - The key name of the dependency\n * @param dependencyValue - The potentially dependent schema\n * @param expandAllBranches - Flag, if true, will return all possible branches of conditions, any/oneOf and dependencies\n * as a list of schemas\n * @param recurseList - The list of recursive references already processed\n * @param [formData]- The current formData to assist retrieving a schema\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - The list of schemas with the dependent schema resolved into them\n */\nexport function withDependentSchema<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n validator: ValidatorType<T, S, F>,\n schema: S,\n rootSchema: S,\n dependencyKey: string,\n dependencyValue: S,\n expandAllBranches: boolean,\n recurseList: string[],\n formData?: T,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): S[] {\n const dependentSchemas = retrieveSchemaInternal<T, S, F>(\n validator,\n dependencyValue,\n rootSchema,\n formData,\n expandAllBranches,\n recurseList,\n experimental_customMergeAllOf,\n );\n return dependentSchemas.flatMap((dependent) => {\n const { oneOf, ...dependentSchema } = dependent;\n const mergedSchema = mergeSchemas(schema, dependentSchema) as S;\n // Since it does not contain oneOf, we return the original schema.\n if (oneOf === undefined) {\n return mergedSchema;\n }\n // Resolve $refs inside oneOf.\n const resolvedOneOfs = oneOf.map((subschema) => {\n if (typeof subschema === 'boolean' || !(REF_KEY in subschema)) {\n return [subschema as S];\n }\n return resolveReference<T, S, F>(validator, subschema as S, rootSchema, expandAllBranches, recurseList, formData);\n });\n const allPermutations = getAllPermutationsOfXxxOf(resolvedOneOfs);\n return allPermutations.flatMap((resolvedOneOf) =>\n withExactlyOneSubschema<T, S, F>(\n validator,\n mergedSchema,\n rootSchema,\n dependencyKey,\n resolvedOneOf,\n expandAllBranches,\n recurseList,\n formData,\n experimental_customMergeAllOf,\n ),\n );\n });\n}\n\n/** Returns a list of `schema`s with the best choice from the `oneOf` options merged into it. If `expandAllBranches` is\n * true, then a list of schemas for ALL options are retrieved and returned. Passes the `expandAllBranches` flag down to\n * the `retrieveSchemaInternal()` helper call.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be used to validate oneOf options\n * @param schema - The schema for which resolving a oneOf subschema is desired\n * @param rootSchema - The root schema that will be forwarded to all the APIs\n * @param dependencyKey - The key name of the oneOf dependency\n * @param oneOf - The list of schemas representing the oneOf options\n * @param expandAllBranches - Flag, if true, will return all possible branches of conditions, any/oneOf and dependencies\n * as a list of schemas\n * @param recurseList - The list of recursive references already processed\n * @param [formData] - The current formData to assist retrieving a schema\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - Either an array containing the best matching option or all options if `expandAllBranches` is true\n */\nexport function withExactlyOneSubschema<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n validator: ValidatorType<T, S, F>,\n schema: S,\n rootSchema: S,\n dependencyKey: string,\n oneOf: S['oneOf'],\n expandAllBranches: boolean,\n recurseList: string[],\n formData?: T,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): S[] {\n const validSubschemas = oneOf!.filter((subschema) => {\n if (typeof subschema === 'boolean' || !subschema?.properties) {\n return false;\n }\n const { [dependencyKey]: conditionPropertySchema } = subschema.properties;\n if (conditionPropertySchema) {\n const conditionSchema: S = {\n type: 'object',\n properties: {\n [dependencyKey]: conditionPropertySchema,\n },\n } as S;\n return validator.isValid(conditionSchema, formData, rootSchema) || expandAllBranches;\n }\n return false;\n });\n\n if (!expandAllBranches && validSubschemas.length !== 1) {\n // oxlint-disable-next-line no-console\n console.warn(\"ignoring oneOf in dependencies because there isn't exactly one subschema that is valid\");\n return [schema];\n }\n return validSubschemas.flatMap((s) => {\n const subschema: S = s as S;\n const [dependentSubschema] = splitKeyElementFromObject(dependencyKey, subschema.properties as GenericObjectType);\n const dependentSchema = { ...subschema, properties: dependentSubschema };\n const schemas = retrieveSchemaInternal<T, S, F>(\n validator,\n dependentSchema,\n rootSchema,\n formData,\n expandAllBranches,\n recurseList,\n experimental_customMergeAllOf,\n );\n return schemas.map((resolvedSubschema) => mergeSchemas(schema, resolvedSubschema) as S);\n });\n}\n", "import get from 'lodash/get';\n\nimport { CONST_KEY, DEFAULT_KEY, PROPERTIES_KEY } from '../constants';\nimport deepEquals from '../deepEquals';\nimport getDiscriminatorFieldFromSchema from '../getDiscriminatorFieldFromSchema';\nimport type {\n Experimental_CustomMergeAllOf,\n FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n ValidatorType,\n} from '../types';\nimport retrieveSchema from './retrieveSchema';\n\n/** Finds the option inside the `schema['any/oneOf']` list which has the `properties[selectorField].default` or\n * `properties[selectorField].const` that matches the `formData[selectorField]` value. For the purposes of this\n * function, `selectorField` is either `schema.discriminator.propertyName` or `fallbackField`. The `LayoutGridField`\n * works directly with schemas in a recursive manner, making this faster than `getFirstMatchingOption()`.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs\n * @param rootSchema - The root schema that will be forwarded to all the APIs\n * @param schema - The schema element in which to search for the selected anyOf/oneOf option\n * @param fallbackField - The field to use as a backup selector field if the schema does not have a required field\n * @param xxx - Either `anyOf` or `oneOf`, defines which value is being sought\n * @param [formData={}] - The form data that is used to determine which anyOf/oneOf option to descend\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - The anyOf/oneOf option that matches the selector field in the schema or undefined if nothing is selected\n */\nexport default function findSelectedOptionInXxxOf<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n validator: ValidatorType<T, S, F>,\n rootSchema: S,\n schema: S,\n fallbackField: string,\n xxx: 'anyOf' | 'oneOf',\n formData: T = {} as T,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): S | undefined {\n if (Array.isArray(schema[xxx])) {\n const discriminator = getDiscriminatorFieldFromSchema<S>(schema);\n const selectorField = discriminator || fallbackField;\n const xxxOfs = schema[xxx].map((xxxOf) =>\n retrieveSchema<T, S, F>(validator, xxxOf as S, rootSchema, formData, experimental_customMergeAllOf),\n );\n const data = get(formData, selectorField);\n if (data !== undefined) {\n return xxxOfs.find((xxxOfOption) =>\n deepEquals(\n get(\n xxxOfOption,\n [PROPERTIES_KEY, selectorField, DEFAULT_KEY],\n get(xxxOfOption, [PROPERTIES_KEY, selectorField, CONST_KEY]),\n ),\n data,\n ),\n );\n }\n }\n return undefined;\n}\n", "import get from 'lodash/get';\nimport has from 'lodash/has';\nimport isEmpty from 'lodash/isEmpty';\n\nimport { REF_KEY } from '../constants';\nimport type {\n Experimental_CustomMergeAllOf,\n FormContextType,\n RJSFSchema,\n SchemaFieldPath,\n StrictRJSFSchema,\n ValidatorType,\n} from '../types';\nimport retrieveSchema from './retrieveSchema';\n\n/** Internal helper function that acts like lodash's `get` but additionally retrieves `$ref`s as needed to get the path\n * for schemas containing potentially nested `$ref`s.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs\n * @param rootSchema - The root schema that will be forwarded to all the APIs\n * @param schema - The current node within the JSON schema recursion\n * @param path - The remaining keys in the path to the desired property\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - The internal schema from the `schema` for the given `path` or undefined if not found\n */\nfunction getFromSchemaInternal<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n validator: ValidatorType<T, S, F>,\n rootSchema: S,\n schema: S,\n path: SchemaFieldPath,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): T | S | undefined {\n let fieldSchema = schema;\n if (has(schema, REF_KEY)) {\n fieldSchema = retrieveSchema<T, S, F>(validator, schema, rootSchema, undefined, experimental_customMergeAllOf);\n }\n if (isEmpty(path)) {\n return fieldSchema;\n }\n const pathList = Array.isArray(path) ? [...path] : path.split('.');\n const [part, ...nestedPath] = pathList;\n if (part !== undefined && part !== '' && has(fieldSchema, part)) {\n fieldSchema = get(fieldSchema, part) as S;\n return getFromSchemaInternal<T, S, F>(\n validator,\n rootSchema,\n fieldSchema,\n nestedPath,\n experimental_customMergeAllOf,\n );\n }\n return undefined;\n}\n\n/** Helper that acts like lodash's `get` but additionally retrieves `$ref`s as needed to get the path for schemas\n * containing potentially nested `$ref`s.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs\n * @param rootSchema - The root schema that will be forwarded to all the APIs\n * @param schema - The current node within the JSON schema recursion\n * @param path - The keys in the path to the desired field\n * @param defaultValue - The value to return if a value is not found for the `pathList` path\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - The inner schema from the `schema` for the given `path` or the `defaultValue` if not found\n */\nexport default function getFromSchema<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n validator: ValidatorType<T, S, F>,\n rootSchema: S,\n schema: S,\n path: SchemaFieldPath,\n defaultValue: T,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): T;\nexport default function getFromSchema<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n validator: ValidatorType<T, S, F>,\n rootSchema: S,\n schema: S,\n path: SchemaFieldPath,\n defaultValue: S,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): S;\nexport default function getFromSchema<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n validator: ValidatorType<T, S, F>,\n rootSchema: S,\n schema: S,\n path: SchemaFieldPath,\n defaultValue: T | S,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): T | S {\n const result = getFromSchemaInternal(validator, rootSchema, schema, path, experimental_customMergeAllOf);\n if (result === undefined) {\n return defaultValue;\n }\n return result;\n}\n", "import get from 'lodash/get';\nimport has from 'lodash/has';\n\nimport { ANY_OF_KEY, ONE_OF_KEY, PROPERTIES_KEY, REQUIRED_KEY } from '../constants';\nimport type {\n Experimental_CustomMergeAllOf,\n FormContextType,\n FoundFieldType,\n RJSFSchema,\n SchemaFieldPath,\n StrictRJSFSchema,\n ValidatorType,\n} from '../types';\nimport findSelectedOptionInXxxOf from './findSelectedOptionInXxxOf';\nimport getFromSchema from './getFromSchema';\n\n/** Unique schema that represents no schema was found, exported for testing purposes */\nexport const NOT_FOUND_SCHEMA = { title: '!@#$_UNKNOWN_$#@!' };\n\n/** Finds the field specified by the `path` within the root or recursed `schema`. If there is no field for the specified\n * `path`, then the default `{ field: undefined, isRequired: undefined }` is returned. It determines whether a leaf\n * field is in the `required` list for its parent and if so, it is marked as required on return.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs\n * @param rootSchema - The root schema that will be forwarded to all the APIs\n * @param schema - The node within the JSON schema in which to search\n * @param path - The keys in the path to the desired field\n * @param [formData={}] - The form data that is used to determine which anyOf/oneOf option to descend\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - An object that contains the field and its required state. If no field can be found then\n * `{ field: undefined, isRequired: undefined }` is returned.\n */\nexport default function findFieldInSchema<\n T = undefined,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n validator: ValidatorType<T, S, F>,\n rootSchema: S,\n schema: S,\n path: SchemaFieldPath,\n formData: T = {} as T,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): FoundFieldType<S> {\n const pathList = Array.isArray(path) ? [...path] : path.split('.');\n let parentField = schema;\n\n // store the desired field into a variable and removing it from the `pathList`\n const fieldName = pathList.pop()!;\n const fieldNameKey = String(fieldName);\n\n if (pathList.length) {\n // drilling into the schema for each sub-path and taking into account of the any/oneOfs\n pathList.forEach((subPath) => {\n parentField = getFromSchema<T, S, F>(\n validator,\n rootSchema,\n parentField,\n [PROPERTIES_KEY, subPath],\n {} as S,\n experimental_customMergeAllOf,\n );\n if (has(parentField, ONE_OF_KEY)) {\n // if this sub-path has a `oneOf` then use the formData to drill into the schema with the selected option\n parentField = findSelectedOptionInXxxOf(\n validator,\n rootSchema,\n parentField,\n fieldNameKey,\n ONE_OF_KEY,\n get(formData, subPath),\n experimental_customMergeAllOf,\n )!;\n } else if (has(parentField, ANY_OF_KEY)) {\n // if this sub-path has a `anyOf` then use the formData to drill into the schema with the selected option\n parentField = findSelectedOptionInXxxOf(\n validator,\n rootSchema,\n parentField,\n fieldNameKey,\n ANY_OF_KEY,\n get(formData, subPath),\n experimental_customMergeAllOf,\n )!;\n }\n });\n }\n\n if (has(parentField, ONE_OF_KEY)) {\n // When oneOf is in the root schema, use the formData to drill into the schema with the selected option\n parentField = findSelectedOptionInXxxOf(\n validator,\n rootSchema,\n parentField,\n fieldNameKey,\n ONE_OF_KEY,\n formData,\n experimental_customMergeAllOf,\n )!;\n } else if (has(parentField, ANY_OF_KEY)) {\n // When anyOf is in the root schema, use the formData to drill into the schema with the selected option\n parentField = findSelectedOptionInXxxOf(\n validator,\n rootSchema,\n parentField,\n fieldNameKey,\n ANY_OF_KEY,\n formData,\n experimental_customMergeAllOf,\n )!;\n }\n\n // taking the most updated `parentField`, get our desired field\n let field: S | undefined = getFromSchema<T, S, F>(\n validator,\n rootSchema,\n parentField,\n [PROPERTIES_KEY, fieldName],\n NOT_FOUND_SCHEMA as S,\n experimental_customMergeAllOf,\n );\n if (field === NOT_FOUND_SCHEMA) {\n field = undefined;\n }\n // check to see if our desired field is in the `required` list for its parent\n const requiredArray = getFromSchema<T, S, F>(\n validator,\n rootSchema,\n parentField,\n REQUIRED_KEY,\n [] as T,\n experimental_customMergeAllOf,\n );\n let isRequired: boolean | undefined;\n if (field && Array.isArray(requiredArray)) {\n isRequired = requiredArray.includes(fieldNameKey);\n }\n\n return { field, isRequired };\n}\n", "/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n}\n\nexport default arrayReduce;\n", "import isArrayLike from './isArrayLike.js';\n\n/**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n}\n\nexport default createBaseEach;\n", "import baseForOwn from './_baseForOwn.js';\nimport createBaseEach from './_createBaseEach.js';\n\n/**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\nvar baseEach = createBaseEach(baseForOwn);\n\nexport default baseEach;\n", "/**\n * The base implementation of `_.reduce` and `_.reduceRight`, without support\n * for iteratee shorthands, which iterates over `collection` using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} accumulator The initial value.\n * @param {boolean} initAccum Specify using the first or last element of\n * `collection` as the initial value.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the accumulated value.\n */\nfunction baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {\n eachFunc(collection, function(value, index, collection) {\n accumulator = initAccum\n ? (initAccum = false, value)\n : iteratee(accumulator, value, index, collection);\n });\n return accumulator;\n}\n\nexport default baseReduce;\n", "import arrayReduce from './_arrayReduce.js';\nimport baseEach from './_baseEach.js';\nimport baseIteratee from './_baseIteratee.js';\nimport baseReduce from './_baseReduce.js';\nimport isArray from './isArray.js';\n\n/**\n * Reduces `collection` to a value which is the accumulated result of running\n * each element in `collection` thru `iteratee`, where each successive\n * invocation is supplied the return value of the previous. If `accumulator`\n * is not given, the first element of `collection` is used as the initial\n * value. The iteratee is invoked with four arguments:\n * (accumulator, value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.reduce`, `_.reduceRight`, and `_.transform`.\n *\n * The guarded methods are:\n * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,\n * and `sortBy`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduceRight\n * @example\n *\n * _.reduce([1, 2], function(sum, n) {\n * return sum + n;\n * }, 0);\n * // => 3\n *\n * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * return result;\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)\n */\nfunction reduce(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduce : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, baseIteratee(iteratee, 4), accumulator, initAccum, baseEach);\n}\n\nexport default reduce;\n", "import get from 'lodash/get';\nimport has from 'lodash/has';\nimport isNumber from 'lodash/isNumber';\nimport isObject from 'lodash/isObject';\nimport isString from 'lodash/isString';\nimport reduce from 'lodash/reduce';\nimport times from 'lodash/times';\n\nimport { ONE_OF_KEY, REF_KEY, JUNK_OPTION_ID, ANY_OF_KEY } from '../constants';\nimport getDiscriminatorFieldFromSchema from '../getDiscriminatorFieldFromSchema';\nimport getOptionMatchingSimpleDiscriminator from '../getOptionMatchingSimpleDiscriminator';\nimport guessType from '../guessType';\nimport type {\n Experimental_CustomMergeAllOf,\n FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n ValidatorType,\n} from '../types';\nimport getFirstMatchingOption from './getFirstMatchingOption';\nimport retrieveSchema, { resolveAllReferences } from './retrieveSchema';\n\n/** A junk option used to determine when the getFirstMatchingOption call really matches an option rather than returning\n * the first item\n */\nexport const JUNK_OPTION: StrictRJSFSchema = {\n type: 'object',\n $id: JUNK_OPTION_ID,\n properties: {\n __not_really_there__: {\n type: 'number',\n },\n },\n};\n\n/** Recursive function that calculates the score of a `formData` against the given `schema`. The computation is fairly\n * simple. Initially the total score is 0. When `schema.properties` object exists, then all the `key/value` pairs within\n * the object are processed as follows after obtaining the formValue from `formData` using the `key`:\n * - If the `value` contains a `$ref`, `calculateIndexScore()` is called recursively with the formValue and the new\n * schema that is the result of the ref in the schema being resolved and that sub-schema's resulting score is added to\n * the total.\n * - If the `value` contains a `oneOf` and there is a formValue, then score based on the index returned from calling\n * `getClosestMatchingOption()` of that oneOf.\n * - If the type of the `value` is 'object', `calculateIndexScore()` is called recursively with the formValue and the\n * `value` itself as the sub-schema, and the score is added to the total.\n * - If the type of the `value` matches the guessed-type of the `formValue`, the score is incremented by 1, UNLESS the\n * value has a `default` or `const`. In those case, if the `default` or `const` and the `formValue` match, the score\n * is incremented by another 1 otherwise it is decremented by 1.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be used when necessary\n * @param rootSchema - The root JSON schema of the entire form\n * @param schema - The schema for which the score is being calculated\n * @param formData - The form data associated with the schema, used to calculate the score\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - The score a schema against the formData\n */\nexport function calculateIndexScore<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n validator: ValidatorType<T, S, F>,\n rootSchema: S,\n schema?: S,\n formData?: any,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): number {\n let totalScore = 0;\n if (schema) {\n if (isObject(schema.properties)) {\n totalScore += reduce(\n schema.properties,\n (score, value, key) => {\n const formValue = get(formData, key);\n if (typeof value === 'boolean') {\n return score;\n }\n if (has(value, REF_KEY)) {\n const newSchema = retrieveSchema<T, S, F>(\n validator,\n value as S,\n rootSchema,\n formValue,\n experimental_customMergeAllOf,\n );\n return (\n score +\n calculateIndexScore<T, S, F>(\n validator,\n rootSchema,\n newSchema,\n formValue || {},\n experimental_customMergeAllOf,\n )\n );\n }\n if ((has(value, ONE_OF_KEY) || has(value, ANY_OF_KEY)) && formValue) {\n const xxxOfKey = has(value, ONE_OF_KEY) ? ONE_OF_KEY : ANY_OF_KEY;\n const discriminator = getDiscriminatorFieldFromSchema<S>(value as S);\n return (\n score +\n getClosestMatchingOption<T, S, F>(\n validator,\n rootSchema,\n formValue,\n get(value, xxxOfKey) as S[],\n -1,\n discriminator,\n experimental_customMergeAllOf,\n )\n );\n }\n if (value.type === 'object') {\n // If the structure is matching then give it a little boost in score\n const structureBoost = isObject(formValue) ? 1 : 0;\n return (\n score +\n structureBoost +\n calculateIndexScore<T, S, F>(validator, rootSchema, value as S, formValue, experimental_customMergeAllOf)\n );\n }\n if (value.type === guessType(formValue)) {\n // If the types match, then we bump the score by one\n let newScore = score + 1;\n if (value.default) {\n // If the schema contains a readonly default value score the value that matches the default higher and\n // any non-matching value lower\n newScore += formValue === value.default ? 1 : -1;\n } else if (value.const) {\n // If the schema contains a const value score the value that matches the default higher and\n // any non-matching value lower\n newScore += formValue === value.const ? 1 : -1;\n }\n // TODO eventually, deal with enums/arrays\n return newScore;\n }\n return score;\n },\n 0,\n );\n } else if (isString(schema.type) && schema.type === guessType(formData)) {\n totalScore += 1;\n }\n }\n return totalScore;\n}\n\n/** Determines which of the given `options` provided most closely matches the `formData`. Using\n * `getFirstMatchingOption()` to match two schemas that differ only by the readOnly, default or const value of a field\n * based on the `formData` and returns 0 when there is no match. Rather than passing in all the `options` at once to\n * this utility, instead an array of valid option indexes is created by iterating over the list of options, call\n * `getFirstMatchingOptions` with a list of one junk option and one good option, seeing if the good option is considered\n * matched.\n *\n * Once the list of valid indexes is created, if there is only one valid index, just return it. Otherwise, if there are\n * no valid indexes, then fill the valid indexes array with the indexes of all the options. Next, the index of the\n * option with the highest score is determined by iterating over the list of valid options, calling\n * `calculateIndexScore()` on each, comparing it against the current best score, and returning the index of the one that\n * eventually has the best score.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be used when necessary\n * @param rootSchema - The root JSON schema of the entire form\n * @param formData - The form data associated with the schema\n * @param options - The list of options that can be selected from\n * @param [selectedOption=-1] - The index of the currently selected option, defaulted to -1 if not specified\n * @param [discriminatorField] - The optional name of the field within the options object whose value is used to\n * determine which option is selected\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - The index of the option that is the closest match to the `formData` or the `selectedOption` if no match\n */\nexport default function getClosestMatchingOption<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n validator: ValidatorType<T, S, F>,\n rootSchema: S,\n formData: T | undefined,\n options: S[],\n selectedOption = -1,\n discriminatorField?: string,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): number {\n // First resolve any refs in the options\n const resolvedOptions = options.map((option) => resolveAllReferences<S>(option, rootSchema, []));\n\n const simpleDiscriminatorMatch = getOptionMatchingSimpleDiscriminator(formData, options, discriminatorField);\n if (isNumber(simpleDiscriminatorMatch)) {\n return simpleDiscriminatorMatch;\n }\n\n // Reduce the array of options down to a list of the indexes that are considered matching options\n const allValidIndexes = resolvedOptions.reduce((validList: number[], option, index: number) => {\n const testOptions: S[] = [JUNK_OPTION as S, option];\n const match = getFirstMatchingOption<T, S, F>(validator, formData, testOptions, rootSchema, discriminatorField);\n // The match is the real option, so add its index to list of valid indexes\n if (match === 1) {\n validList.push(index);\n }\n return validList;\n }, []);\n\n // There is only one valid index, so return it!\n if (allValidIndexes.length === 1) {\n return allValidIndexes[0];\n }\n if (!allValidIndexes.length) {\n // No indexes were valid, so we'll score all the options, add all the indexes\n times(resolvedOptions.length, (i) => allValidIndexes.push(i));\n }\n interface BestType {\n bestIndex: number;\n bestScore: number;\n }\n const scoreCount = new Set<number>();\n // Score all the options in the list of valid indexes and return the index with the best score\n const { bestIndex }: BestType = allValidIndexes.reduce(\n (scoreData: BestType, index: number) => {\n const { bestScore } = scoreData;\n const option = resolvedOptions[index];\n const score = calculateIndexScore(validator, rootSchema, option, formData, experimental_customMergeAllOf);\n scoreCount.add(score);\n if (score > bestScore) {\n return { bestIndex: index, bestScore: score };\n }\n return scoreData;\n },\n { bestIndex: selectedOption, bestScore: 0 },\n );\n // if all scores are the same go with selectedOption\n if (scoreCount.size === 1 && selectedOption >= 0) {\n return selectedOption;\n }\n\n return bestIndex;\n}\n", "import type { JSONSchema7Type } from 'json-schema';\nimport isString from 'lodash/isString';\n\nimport { CONST_KEY, getSchemaType, isObject } from './';\nimport type { RJSFSchema, StrictRJSFSchema } from './types';\n\n/**\n * Checks if the schema const property value is an AJV $data reference\n * and the current schema is not an object or array\n *\n * @param schema - The schema to check if the const is an AJV $data reference\n * @returns - true if the schema const property value is an AJV $data reference otherwise false.\n */\nexport default function constIsAjvDataReference<S extends StrictRJSFSchema = RJSFSchema>(schema: S): boolean {\n const schemaConst = schema[CONST_KEY] as JSONSchema7Type & { $data: string };\n const schemaType = getSchemaType<S>(schema);\n return isObject(schemaConst) && isString(schemaConst?.$data) && schemaType !== 'object' && schemaType !== 'array';\n}\n", "import { CONST_KEY } from './constants';\nimport type { RJSFSchema, StrictRJSFSchema } from './types';\n\n/** This function checks if the given `schema` matches a single constant value. This happens when either the schema has\n * an `enum` array with a single value or there is a `const` defined.\n *\n * @param schema - The schema for a field\n * @returns - True if the `schema` has a single constant value, false otherwise\n */\nexport default function isConstant<S extends StrictRJSFSchema = RJSFSchema>(schema: S) {\n return (Array.isArray(schema.enum) && schema.enum.length === 1) || CONST_KEY in schema;\n}\n", "import isObject from './isObject';\nimport type { RJSFSchema, StrictRJSFSchema } from './types';\n\n/** Detects whether the given `schema` contains fixed items. This is the case when `schema.items` is an array that only\n * contains objects.\n *\n * @param schema - The schema in which to check for fixed items\n * @returns - True if there are fixed items in the schema, false otherwise\n */\nexport default function isFixedItems<S extends StrictRJSFSchema = RJSFSchema>(schema: S) {\n return Array.isArray(schema.items) && schema.items.every((item) => isObject(item));\n}\n", "/**\n * Checks if `value` is `null` or `undefined`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is nullish, else `false`.\n * @example\n *\n * _.isNil(null);\n * // => true\n *\n * _.isNil(void 0);\n * // => true\n *\n * _.isNil(NaN);\n * // => false\n */\nfunction isNil(value) {\n return value == null;\n}\n\nexport default isNil;\n", "import get from 'lodash/get';\nimport isNil from 'lodash/isNil';\n\nimport type { GenericObjectType } from '../src';\nimport isObject from './isObject';\n\n/** Merges the `defaults` object of type `T` into the `formData` of type `T`\n *\n * When merging defaults and form data, we want to merge in this specific way:\n * - objects are deeply merged\n * - arrays are merged in such a way that:\n * - when the array is set in form data, only array entries set in form data\n * are deeply merged; additional entries from the defaults are ignored unless `mergeExtraArrayDefaults` is true, in\n * which case the extras are appended onto the end of the form data\n * - when the array is not set in form data, the default is copied over\n * - scalars are overwritten/set by form data unless undefined and there is a default AND `defaultSupercedesUndefined`\n * is true\n *\n * @param [defaults] - The defaults to merge\n * @param [formData] - The form data into which the defaults will be merged\n * @param [mergeExtraArrayDefaults=false] - If true, any additional default array entries are appended onto the formData\n * @param [defaultSupercedesUndefined=false] - If true, an explicit undefined value will be overwritten by the default value\n * @param [overrideFormDataWithDefaults=false] - If true, the default value will overwrite the form data value. If the value\n * doesn't exist in the default, we take it from formData and in the case where the value is set to undefined in formData.\n * This is useful when we have already merged formData with defaults and want to add an additional field from formData\n * that does not exist in defaults.\n * @returns - The resulting merged form data with defaults\n */\nexport default function mergeDefaultsWithFormData<T = any>(\n defaults?: T,\n formData?: T,\n mergeExtraArrayDefaults = false,\n defaultSupercedesUndefined = false,\n overrideFormDataWithDefaults = false,\n): T | undefined {\n if (Array.isArray(formData)) {\n const defaultsArray = Array.isArray(defaults) ? defaults : [];\n\n // If overrideFormDataWithDefaults is true, we want to override the formData with the defaults\n const overrideArray = overrideFormDataWithDefaults ? defaultsArray : formData;\n const overrideOppositeArray = overrideFormDataWithDefaults ? formData : defaultsArray;\n\n const mapped = overrideArray.map((value, idx) => {\n // We want to explicitly make sure that the value is NOT undefined since null, 0 and empty space are valid values\n if (overrideOppositeArray[idx] !== undefined) {\n return mergeDefaultsWithFormData(\n defaultsArray[idx],\n formData[idx],\n mergeExtraArrayDefaults,\n defaultSupercedesUndefined,\n overrideFormDataWithDefaults,\n );\n }\n return value;\n });\n\n // Merge any extra defaults when mergeExtraArrayDefaults is true\n // Or when overrideFormDataWithDefaults is true and the default array is shorter than the formData array\n if ((mergeExtraArrayDefaults || overrideFormDataWithDefaults) && mapped.length < overrideOppositeArray.length) {\n mapped.push(...overrideOppositeArray.slice(mapped.length));\n }\n return mapped as unknown as T;\n }\n if (isObject(formData)) {\n // oxlint-disable-next-line prefer-object-spread -- spread loses T type, Object.assign preserves it\n const acc: { [key in keyof T]: any } = Object.assign({}, defaults); // Prevent mutation of source object.\n return Object.keys(formData as GenericObjectType).reduce((accumulator, key) => {\n const keyValue = get(formData, key);\n const keyExistsInDefaults = isObject(defaults) && key in (defaults as GenericObjectType);\n const keyExistsInFormData = key in (formData as GenericObjectType);\n const keyDefault = get(defaults, key) ?? {};\n const defaultValueIsNestedObject =\n keyExistsInDefaults && isObject(keyDefault) && Object.values(keyDefault).some((v) => isObject(v));\n\n const keyDefaultIsObject = keyExistsInDefaults && isObject(get(defaults, key));\n const keyHasFormDataObject = keyExistsInFormData && isObject(keyValue);\n\n if (keyDefaultIsObject && keyHasFormDataObject && !defaultValueIsNestedObject) {\n accumulator[key as keyof T] = {\n ...get(defaults, key),\n ...keyValue,\n };\n return accumulator;\n }\n\n accumulator[key as keyof T] = mergeDefaultsWithFormData<T>(\n get(defaults, key),\n keyValue,\n mergeExtraArrayDefaults,\n defaultSupercedesUndefined,\n // overrideFormDataWithDefaults can be true only when the key value exists in defaults\n // Or if the key value doesn't exist in formData\n overrideFormDataWithDefaults && (keyExistsInDefaults || !keyExistsInFormData),\n );\n return acc;\n }, acc);\n }\n\n /**\n * If the defaultSupercedesUndefined flag is true\n * And formData is set to undefined or null and defaults are defined\n * Or if formData is a number and is NaN return defaults\n * Or if overrideFormDataWithDefaults flag is true and formData is set to not undefined/null return defaults\n */\n if (\n (defaultSupercedesUndefined &&\n ((!(defaults === undefined) && isNil(formData)) || (typeof formData === 'number' && Number.isNaN(formData)))) ||\n (overrideFormDataWithDefaults && !isNil(formData))\n ) {\n return defaults;\n }\n\n return formData;\n}\n", "import isObject from './isObject';\nimport type { GenericObjectType } from './types';\n\n/** Recursively merge deeply nested objects.\n *\n * @param obj1 - The first object to merge\n * @param obj2 - The second object to merge\n * @param [concatArrays=false] - Optional flag that, when true, will cause arrays to be concatenated. Use\n * \"preventDuplicates\" to merge arrays in a manner that prevents any duplicate entries from being merged.\n * NOTE: Uses shallow comparison for the duplicate checking.\n * @returns - A new object that is the merge of the two given objects\n */\nexport default function mergeObjects(\n obj1: GenericObjectType,\n obj2: GenericObjectType,\n concatArrays: boolean | 'preventDuplicates' = false,\n) {\n return Object.keys(obj2).reduce(\n (acc, key) => {\n const left = obj1 ? obj1[key] : {},\n right = obj2[key];\n if (obj1 && key in obj1 && isObject(right)) {\n acc[key] = mergeObjects(left, right, concatArrays);\n } else if (concatArrays && Array.isArray(left) && Array.isArray(right)) {\n let toMerge = right;\n if (concatArrays === 'preventDuplicates') {\n toMerge = right.reduce((result, value) => {\n if (!left.includes(value)) {\n result.push(value);\n }\n return result;\n }, []);\n }\n acc[key] = left.concat(toMerge);\n } else {\n acc[key] = right;\n }\n return acc;\n },\n { ...obj1 },\n ); // Prevent mutation of source object.\n}\n", "import { CONST_KEY, ENUM_KEY } from './constants';\nimport type { RJSFSchema, StrictRJSFSchema } from './types';\n\n/** Returns the constant value from the schema when it is either a single value enum or has a const key. Otherwise\n * throws an error.\n *\n * @param schema - The schema from which to obtain the constant value\n * @returns - The constant value for the schema\n * @throws - Error when the schema does not have a constant value\n */\nexport default function toConstant<S extends StrictRJSFSchema = RJSFSchema>(schema: S) {\n if (ENUM_KEY in schema && Array.isArray(schema.enum) && schema.enum.length === 1) {\n return schema.enum[0];\n }\n if (CONST_KEY in schema) {\n return schema.const;\n }\n throw new Error('schema cannot be inferred as a constant');\n}\n", "import get from 'lodash/get';\n\nimport { CONST_KEY, DEFAULT_KEY, PROPERTIES_KEY } from './constants';\nimport getDiscriminatorFieldFromSchema from './getDiscriminatorFieldFromSchema';\nimport getUiOptions from './getUiOptions';\nimport toConstant from './toConstant';\nimport type { RJSFSchema, EnumOptionsType, EnumValue, StrictRJSFSchema, FormContextType, UiSchema } from './types';\n\n/** Reorders `options` according to `order`, which may contain a `'*'` wildcard representing all\n * remaining options in their original order. Options not listed in `order` (and not covered by\n * a wildcard) are dropped.\n */\nfunction applyEnumOrder<S extends StrictRJSFSchema = RJSFSchema>(\n options: EnumOptionsType<S>[],\n order: EnumValue[],\n): EnumOptionsType<S>[] {\n const optionsByValue = new Map(options.map((opt) => [String(opt.value), opt]));\n const orderedKeys = new Set(order.filter((v) => v !== '*').map(String));\n const rest = options.filter((opt) => !orderedKeys.has(String(opt.value)));\n\n return order.flatMap((entry) => {\n if (entry === '*') {\n return rest;\n }\n const opt = optionsByValue.get(String(entry));\n return opt ? [opt] : [];\n });\n}\n\n/** Gets the list of options from the `schema`. If the schema has an enum list, then those enum values are returned. The\n * label will be the same as the `value`.\n *\n * If the schema has a `oneOf` or `anyOf`, then the value is the list of either:\n * - The `const` values from the schema if present\n * - If the schema has a discriminator and the label using either the `schema.title` or the value. If a `uiSchema` is\n * provided, and it has the `ui:enumNames` matched with `enum` or it has an associated `oneOf` or `anyOf` with a list of\n * objects containing `ui:title` then the UI schema values will replace the values from the schema.\n *\n * @param schema - The schema from which to extract the options list\n * @param [uiSchema] - The optional uiSchema from which to get alternate labels for the options\n * @returns - The list of options from the schema\n */\nexport default function optionsList<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n schema: S,\n uiSchema?: UiSchema<T, S, F>,\n): EnumOptionsType<S>[] | undefined {\n if (schema.enum) {\n let enumNames: string[] | Record<string | number, string> | undefined;\n let enumOrder: EnumValue[] | undefined;\n if (uiSchema) {\n const { enumNames: uiEnumNames, enumOrder: uiEnumOrder } = getUiOptions<T, S, F>(uiSchema);\n enumNames = uiEnumNames;\n enumOrder = uiEnumOrder;\n }\n let options = schema.enum.map((value, i) => {\n const label = Array.isArray(enumNames)\n ? enumNames[i] || String(value)\n : enumNames?.[String(value)] || String(value);\n return { label, value };\n });\n if (enumOrder) {\n options = applyEnumOrder(options, enumOrder);\n }\n return options;\n }\n let altSchemas: S['anyOf'] | S['oneOf'] = undefined;\n let altUiSchemas: UiSchema<T, S, F> | undefined = undefined;\n if (schema.anyOf) {\n altSchemas = schema.anyOf;\n altUiSchemas = uiSchema?.anyOf;\n } else if (schema.oneOf) {\n altSchemas = schema.oneOf;\n altUiSchemas = uiSchema?.oneOf;\n }\n // See if there is a discriminator path specified in the schema, and if so, use it as the selectorField, otherwise\n // pull one from the uiSchema\n let selectorField = getDiscriminatorFieldFromSchema<S>(schema);\n if (uiSchema) {\n const { optionsSchemaSelector = selectorField } = getUiOptions<T, S, F>(uiSchema);\n selectorField = optionsSchemaSelector;\n }\n return altSchemas?.map((aSchemaDef, index) => {\n const { title } = getUiOptions<T, S, F>(altUiSchemas?.[index]);\n const aSchema = aSchemaDef as S;\n let value: EnumOptionsType<S>['value'];\n let label = title;\n if (selectorField) {\n const innerSchema: S = get(aSchema, [PROPERTIES_KEY, selectorField], {}) as S;\n value = get(innerSchema, DEFAULT_KEY, get(innerSchema, CONST_KEY));\n // Use nullish coalescing so that an explicitly empty string title is preserved\n label = label ?? innerSchema?.title ?? aSchema.title ?? String(value);\n } else {\n value = toConstant(aSchema);\n label = label ?? aSchema.title ?? String(value);\n }\n return {\n schema: aSchema,\n label,\n value,\n };\n });\n}\n", "import isConstant from '../isConstant';\nimport type {\n FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n ValidatorType,\n Experimental_CustomMergeAllOf,\n} from '../types';\nimport retrieveSchema from './retrieveSchema';\n\n/** Checks to see if the `schema` combination represents a select\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be used when necessary\n * @param theSchema - The schema for which check for a select flag is desired\n * @param [rootSchema] - The root schema, used to primarily to look up `$ref`s\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - True if schema contains a select, otherwise false\n */\nexport default function isSelect<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n validator: ValidatorType<T, S, F>,\n theSchema: S,\n rootSchema: S = {} as S,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n) {\n const schema = retrieveSchema<T, S, F>(validator, theSchema, rootSchema, undefined, experimental_customMergeAllOf);\n const altSchemas = schema.oneOf || schema.anyOf;\n if (Array.isArray(schema.enum)) {\n return true;\n }\n if (Array.isArray(altSchemas)) {\n return altSchemas.every((altSchema) => typeof altSchema !== 'boolean' && isConstant(altSchema));\n }\n return false;\n}\n", "import type {\n FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n ValidatorType,\n Experimental_CustomMergeAllOf,\n} from '../types';\nimport isSelect from './isSelect';\n\n/** Checks to see if the `schema` combination represents a multi-select\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be used when necessary\n * @param schema - The schema for which check for a multi-select flag is desired\n * @param [rootSchema] - The root schema, used to primarily to look up `$ref`s\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - True if schema contains a multi-select, otherwise false\n */\nexport default function isMultiSelect<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n validator: ValidatorType<T, S, F>,\n schema: S,\n rootSchema?: S,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n) {\n if (!schema.uniqueItems || !schema.items || typeof schema.items === 'boolean') {\n return false;\n }\n return isSelect<T, S, F>(validator, schema.items as S, rootSchema, experimental_customMergeAllOf);\n}\n", "import type { JSONSchema7Object } from 'json-schema';\nimport get from 'lodash/get';\nimport isEmpty from 'lodash/isEmpty';\n\nimport {\n ALL_OF_KEY,\n ANY_OF_KEY,\n CONST_KEY,\n DEFAULT_KEY,\n DEPENDENCIES_KEY,\n IF_KEY,\n ONE_OF_KEY,\n PROPERTIES_KEY,\n REF_KEY,\n} from '../constants';\nimport constIsAjvDataReference from '../constIsAjvDataReference';\nimport deepEquals from '../deepEquals';\nimport findSchemaDefinition from '../findSchemaDefinition';\nimport getDiscriminatorFieldFromSchema from '../getDiscriminatorFieldFromSchema';\nimport getSchemaType from '../getSchemaType';\nimport isConstant from '../isConstant';\nimport isFixedItems from '../isFixedItems';\nimport isObject from '../isObject';\nimport mergeDefaultsWithFormData from '../mergeDefaultsWithFormData';\nimport mergeObjects from '../mergeObjects';\nimport mergeSchemas from '../mergeSchemas';\nimport optionsList from '../optionsList';\nimport type {\n Experimental_CustomMergeAllOf,\n Experimental_DefaultFormStateBehavior,\n FormContextType,\n GenericObjectType,\n RJSFSchema,\n StrictRJSFSchema,\n ValidatorType,\n} from '../types';\nimport getClosestMatchingOption from './getClosestMatchingOption';\nimport isMultiSelect from './isMultiSelect';\nimport isSelect from './isSelect';\nimport retrieveSchema, { resolveDependencies } from './retrieveSchema';\n\nconst PRIMITIVE_TYPES = ['string', 'number', 'integer', 'boolean', 'null'];\n\n/** Enum that indicates how `schema.additionalItems` should be handled by the `getInnerSchemaForArrayItem()` function.\n */\nexport enum AdditionalItemsHandling {\n Ignore,\n Invert,\n Fallback,\n}\n\n/** Given a `schema` will return an inner schema that for an array item. This is computed differently based on the\n * `additionalItems` enum and the value of `idx`. There are four possible returns:\n * 1. If `idx` is >= 0, then if `schema.items` is an array the `idx`th element of the array is returned if it is a valid\n * index and not a boolean, otherwise it falls through to 3.\n * 2. If `schema.items` is not an array AND truthy and not a boolean, then `schema.items` is returned since it actually\n * is a schema, otherwise it falls through to 3.\n * 3. If `additionalItems` is not `AdditionalItemsHandling.Ignore` and `schema.additionalItems` is an object, then\n * `schema.additionalItems` is returned since it actually is a schema, otherwise it falls through to 4.\n * 4. {} is returned representing an empty schema\n *\n * @param schema - The schema from which to get the particular item\n * @param [additionalItems=AdditionalItemsHandling.Ignore] - How do we want to handle additional items?\n * @param [idx=-1] - Index, if non-negative, will be used to return the idx-th element in a `schema.items` array\n * @returns - The best fit schema object from the `schema` given the `additionalItems` and `idx` modifiers\n */\nexport function getInnerSchemaForArrayItem<S extends StrictRJSFSchema = RJSFSchema>(\n schema: S,\n additionalItems: AdditionalItemsHandling = AdditionalItemsHandling.Ignore,\n idx = -1,\n): S {\n if (idx >= 0) {\n if (Array.isArray(schema.items) && idx < schema.items.length) {\n const item = schema.items[idx];\n if (typeof item !== 'boolean') {\n return item as S;\n }\n }\n } else if (schema.items && !Array.isArray(schema.items) && typeof schema.items !== 'boolean') {\n return schema.items as S;\n }\n if (additionalItems !== AdditionalItemsHandling.Ignore && isObject(schema.additionalItems)) {\n return schema.additionalItems as S;\n }\n return {} as S;\n}\n\n/** Checks if the given `schema` contains the `null` type along with another type AND if the `default` contained within\n * the schema is `null` AND the `computedDefault` is empty. If all of those conditions are true, then the `schema`'s\n * default should be `null` rather than `computedDefault`.\n *\n * @param schema - The schema to inspect\n * @param computedDefault - The computed default for the schema\n * @returns - Flag indicating whether a null should be returned instead of the computedDefault\n */\nexport function computeDefaultBasedOnSchemaTypeAndDefaults<T = any, S extends StrictRJSFSchema = RJSFSchema>(\n schema: S,\n computedDefault: T,\n) {\n const { default: schemaDefault, type } = schema;\n const shouldReturnNullAsDefault =\n Array.isArray(type) && type.includes('null') && isEmpty(computedDefault) && schemaDefault === null;\n return shouldReturnNullAsDefault ? (null as T) : computedDefault;\n}\n\n/** Either add `computedDefault` at `key` into `obj` or not add it based on its value, the value of\n * `includeUndefinedValues`, the value of `emptyObjectFields` and if its parent field is required. Generally undefined\n * `computedDefault` values are added only when `includeUndefinedValues` is either true/\"excludeObjectChildren\". If `\n * includeUndefinedValues` is false and `emptyObjectFields` is not \"skipDefaults\", then non-undefined and non-empty-object\n * values will be added based on certain conditions.\n *\n * @param acc - The object into which the computed default may be added\n * @param key - The key into the object at which the computed default may be added\n * @param computedDefault - The computed default value that maybe should be added to the obj\n * @param includeUndefinedValues - Optional flag, if true, cause undefined values to be added as defaults.\n * If \"excludeObjectChildren\", cause undefined values for this object and pass `includeUndefinedValues` as\n * false when computing defaults for any nested object properties. If \"allowEmptyObject\", prevents undefined\n * values in this object while allow the object itself to be empty and passing `includeUndefinedValues` as\n * false when computing defaults for any nested object properties.\n * @param isParentRequired - The optional boolean that indicates whether the parent field is required\n * @param requiredFields - The list of fields that are required\n * @param experimental_defaultFormStateBehavior - Optional configuration object, if provided, allows users to override\n * default form state behavior\n * @param isConst - Optional flag, if true, indicates that the schema has a const property defined, thus we should always return the computedDefault since it's coming from the const.\n * @param isNullType - The type of the schema is null\n */\nfunction maybeAddDefaultToObject<T = any>(\n acc: GenericObjectType,\n key: string,\n computedDefault: T | T[] | undefined,\n includeUndefinedValues: boolean | 'excludeObjectChildren',\n isParentRequired?: boolean,\n requiredFields: string[] = [],\n experimental_defaultFormStateBehavior: Experimental_DefaultFormStateBehavior = {},\n isConst = false,\n isNullType = false,\n) {\n const { emptyObjectFields = 'populateAllDefaults' } = experimental_defaultFormStateBehavior;\n\n if (includeUndefinedValues === true || isConst) {\n // If includeUndefinedValues is explicitly true\n // Or if the schema has a const property defined, then we should always return the computedDefault since it's coming from the const.\n acc[key] = computedDefault;\n } else if (includeUndefinedValues === 'excludeObjectChildren') {\n // Fix for Issue #4709: When in 'excludeObjectChildren' mode, don't set primitive fields to empty objects\n // Only add the computed default if it's not an empty object placeholder for a primitive field\n if ((isNullType && computedDefault !== undefined) || !isObject(computedDefault) || !isEmpty(computedDefault)) {\n acc[key] = computedDefault;\n }\n // If computedDefault is an empty object {}, don't add it - let the field stay undefined\n } else if (emptyObjectFields !== 'skipDefaults') {\n // If isParentRequired is undefined, then we are at the root level of the schema so defer to the requiredness of\n // the field key itself in the `requiredField` list\n const isSelfOrParentRequired = isParentRequired === undefined ? requiredFields.includes(key) : isParentRequired;\n\n if (isObject(computedDefault)) {\n // If emptyObjectFields 'skipEmptyDefaults' store computedDefault if it's a non-empty object(e.g. not {})\n if (emptyObjectFields === 'skipEmptyDefaults') {\n if (!isEmpty(computedDefault)) {\n acc[key] = computedDefault;\n }\n } // Else store computedDefault if it's a non-empty object(e.g. not {}) and satisfies certain conditions\n // Condition 1: If computedDefault is not empty or if the key is a required field\n // Condition 2: If the parent object is required or emptyObjectFields is not 'populateRequiredDefaults'\n else if (\n (!isEmpty(computedDefault) || requiredFields.includes(key)) &&\n (isSelfOrParentRequired || emptyObjectFields !== 'populateRequiredDefaults')\n ) {\n acc[key] = computedDefault;\n }\n } else if (\n // Store computedDefault if it's a defined primitive (e.g., true) and satisfies certain conditions\n // Condition 1: computedDefault is not undefined\n // Condition 2: If emptyObjectFields is 'populateAllDefaults' or 'skipEmptyDefaults)\n // Or if isSelfOrParentRequired is 'true' and the key is a required field\n computedDefault !== undefined &&\n (emptyObjectFields === 'populateAllDefaults' ||\n emptyObjectFields === 'skipEmptyDefaults' ||\n (isSelfOrParentRequired && requiredFields.includes(key)))\n ) {\n acc[key] = computedDefault;\n }\n }\n}\n\ninterface ComputeDefaultsProps<T = any, S extends StrictRJSFSchema = RJSFSchema> {\n /** Any defaults provided by the parent field in the schema */\n parentDefaults?: T;\n /** The options root schema, used to primarily to look up `$ref`s */\n rootSchema?: S;\n /** The current formData, if any, onto which to provide any missing defaults */\n rawFormData?: T;\n /** Optional flag, if true, cause undefined values to be added as defaults.\n * If \"excludeObjectChildren\", cause undefined values for this object and pass `includeUndefinedValues` as\n * false when computing defaults for any nested object properties.\n */\n includeUndefinedValues?: boolean | 'excludeObjectChildren';\n /** The list of ref names currently being recursed, used to prevent infinite recursion */\n _recurseList?: string[];\n /** Optional configuration object, if provided, allows users to override default form state behavior */\n experimental_defaultFormStateBehavior?: Experimental_DefaultFormStateBehavior;\n /** Optional function that allows for custom merging of `allOf` schemas */\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>;\n /** Optional flag, if true, indicates this schema was required in the parent schema. */\n required?: boolean;\n /** Optional flag, if true, indicates this schema was required because it is the root. */\n requiredAsRoot?: boolean;\n /** Optional flag, if true, It will merge defaults into formData.\n * The formData should take precedence unless it's not valid. This is useful when for example the value from formData does not exist in the schema 'enum' property, in such cases we take the value from the defaults because the value from the formData is not valid.\n */\n shouldMergeDefaultsIntoFormData?: boolean;\n /** Indicates whether initial defaults have been generated */\n initialDefaultsGenerated?: boolean;\n}\n\n/** Computes the defaults for the current `schema` given the `rawFormData` and `parentDefaults` if any. This drills into\n * each level of the schema, recursively, to fill out every level of defaults provided by the schema.\n *\n * @param validator - an implementation of the `ValidatorType` interface that will be used when necessary\n * @param rawSchema - The schema for which the default state is desired\n * @param computeDefaultsProps - Optional props for this function\n * @returns - The resulting `formData` with all the defaults provided\n */\nexport function computeDefaults<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n validator: ValidatorType<T, S, F>,\n rawSchema: S,\n computeDefaultsProps: ComputeDefaultsProps<T, S> = {},\n): T | T[] | undefined {\n const {\n parentDefaults,\n rawFormData,\n rootSchema = {} as S,\n includeUndefinedValues = false,\n _recurseList = [],\n experimental_defaultFormStateBehavior,\n experimental_customMergeAllOf,\n required,\n shouldMergeDefaultsIntoFormData = false,\n initialDefaultsGenerated,\n } = computeDefaultsProps;\n let formData: T = (isObject(rawFormData) ? rawFormData : {}) as T;\n const schema: S = isObject(rawSchema) ? rawSchema : ({} as S);\n // Compute the defaults recursively: give highest priority to deepest nodes unless nestedDefaultsPrecedence is ancestorWins.\n let defaults: T | T[] | undefined = parentDefaults;\n const preferParentDefaults =\n defaults && experimental_defaultFormStateBehavior?.nestedDefaultsPrecedence === 'ancestorWins';\n // If we get a new schema, then we need to recompute defaults again for the new schema found.\n let schemaToCompute: S | null = null;\n let experimental_dfsb_to_compute = experimental_defaultFormStateBehavior;\n let updatedRecurseList = _recurseList;\n if (\n schema[CONST_KEY] !== undefined &&\n experimental_defaultFormStateBehavior?.constAsDefaults !== 'never' &&\n !constIsAjvDataReference(schema)\n ) {\n defaults = schema[CONST_KEY] as unknown as T;\n } else if (\n isObject(defaults) &&\n isObject(schema.default) &&\n !schema[ANY_OF_KEY] &&\n !schema[ONE_OF_KEY] &&\n !schema[REF_KEY]\n ) {\n // For object defaults, merge defaults by precedence setting.\n // Skip this for anyOf/oneOf/$ref schemas - they need special handling.\n if (preferParentDefaults) {\n // Use schema.default as the base and only override values that are defined in parent defaults.\n defaults = mergeObjects(schema.default as GenericObjectType, defaults) as T;\n } else {\n // Only override parent defaults that are defined in schema.default.\n defaults = mergeObjects(defaults, schema.default as GenericObjectType) as T;\n }\n } else if (\n DEFAULT_KEY in schema &&\n !preferParentDefaults &&\n !schema[ANY_OF_KEY] &&\n !schema[ONE_OF_KEY] &&\n !schema[REF_KEY]\n ) {\n // If the schema has a default value and parentDefaults does not have precedence\n // And if the schema does not have anyOf or oneOf (since we need to merge the defaults with the formData)\n // Then we should use it as the default.\n defaults = schema.default as unknown as T;\n } else if (REF_KEY in schema) {\n const refName = schema[REF_KEY];\n // Use referenced schema defaults for this node.\n if (!_recurseList.includes(refName!)) {\n updatedRecurseList = _recurseList.concat(refName!);\n schemaToCompute = findSchemaDefinition<S>(refName, rootSchema);\n }\n\n // If the referenced schema exists and parentDefaults is not set\n // Then set the defaults from the current schema for the referenced schema.\n // Only do this if rawFormData has no meaningful data - we don't want to override user's existing values.\n // Check for undefined OR empty object - rawFormData may be coerced to {} when not an object.\n const hasNoExistingData = rawFormData === undefined || (isObject(rawFormData) && isEmpty(rawFormData));\n if (schemaToCompute && !defaults && hasNoExistingData) {\n defaults = schema.default as T | undefined;\n }\n\n // If shouldMergeDefaultsIntoFormData is true\n // And the schemaToCompute is set and the rawFormData is not an object\n // Then set the formData to the rawFormData\n if (shouldMergeDefaultsIntoFormData && schemaToCompute && !isObject(rawFormData)) {\n formData = rawFormData as T;\n }\n } else if (DEPENDENCIES_KEY in schema) {\n // Get the default if set from properties to ensure the dependencies conditions are resolved based on it\n const defaultFormData: T = {\n ...getDefaultBasedOnSchemaType(validator, schema, computeDefaultsProps, defaults),\n ...formData,\n };\n const resolvedSchema = resolveDependencies<T, S, F>(\n validator,\n schema,\n rootSchema,\n false,\n [],\n defaultFormData,\n experimental_customMergeAllOf,\n );\n [schemaToCompute] = resolvedSchema; // pick the first element from resolve dependencies\n } else if (isFixedItems(schema) && !preferParentDefaults) {\n // If the schema contains fixed items and parentDefaults does not have precedence\n // Then construct defaults from defaults of array items.\n defaults = (schema.items! as S[]).map((itemSchema: S, idx: number) =>\n computeDefaults<T, S>(validator, itemSchema, {\n rootSchema,\n includeUndefinedValues,\n _recurseList,\n experimental_defaultFormStateBehavior,\n experimental_customMergeAllOf,\n parentDefaults: Array.isArray(parentDefaults) ? parentDefaults[idx] : undefined,\n rawFormData: formData,\n required,\n shouldMergeDefaultsIntoFormData,\n }),\n ) as T[];\n } else if (ONE_OF_KEY in schema) {\n const { oneOf, ...remaining } = schema;\n if (oneOf!.length === 0) {\n return undefined;\n }\n const discriminator = getDiscriminatorFieldFromSchema<S>(schema);\n const { type = 'null' } = remaining;\n if (\n !Array.isArray(type) &&\n PRIMITIVE_TYPES.includes(type) &&\n experimental_dfsb_to_compute?.constAsDefaults === 'skipOneOf'\n ) {\n // If we are in a oneOf of a primitive type, then we want to pass constAsDefaults as 'never' for the recursion\n experimental_dfsb_to_compute = {\n ...experimental_dfsb_to_compute,\n constAsDefaults: 'never',\n };\n }\n schemaToCompute = oneOf![\n getClosestMatchingOption<T, S, F>(\n validator,\n rootSchema,\n rawFormData ?? (schema.default as T),\n oneOf as S[],\n 0,\n discriminator,\n experimental_customMergeAllOf,\n )\n ] as S;\n schemaToCompute = mergeSchemas(remaining, schemaToCompute) as S;\n } else if (ANY_OF_KEY in schema) {\n const { anyOf, ...remaining } = schema;\n if (anyOf!.length === 0) {\n return undefined;\n }\n const discriminator = getDiscriminatorFieldFromSchema<S>(schema);\n schemaToCompute = anyOf![\n getClosestMatchingOption<T, S, F>(\n validator,\n rootSchema,\n rawFormData ?? (schema.default as T),\n anyOf as S[],\n 0,\n discriminator,\n experimental_customMergeAllOf,\n )\n ] as S;\n schemaToCompute = mergeSchemas(remaining, schemaToCompute) as S;\n }\n\n if (schemaToCompute) {\n return computeDefaults<T, S, F>(validator, schemaToCompute, {\n rootSchema,\n includeUndefinedValues,\n _recurseList: updatedRecurseList,\n experimental_defaultFormStateBehavior: experimental_dfsb_to_compute,\n experimental_customMergeAllOf,\n parentDefaults: defaults as T | undefined,\n rawFormData: rawFormData ?? formData,\n required,\n shouldMergeDefaultsIntoFormData,\n initialDefaultsGenerated,\n });\n }\n\n // No defaults defined for this node, fallback to generic typed ones.\n if (defaults === undefined) {\n defaults = schema.default as unknown as T;\n }\n\n const defaultBasedOnSchemaType = getDefaultBasedOnSchemaType(validator, schema, computeDefaultsProps, defaults);\n\n let defaultsWithFormData = defaultBasedOnSchemaType ?? defaults;\n // if shouldMergeDefaultsIntoFormData is true, then merge the defaults into the formData.\n if (shouldMergeDefaultsIntoFormData) {\n const { arrayMinItems = {} } = experimental_defaultFormStateBehavior || {};\n const { mergeExtraDefaults } = arrayMinItems;\n\n const matchingFormData = ensureFormDataMatchingSchema(\n validator,\n schema,\n rootSchema,\n rawFormData,\n experimental_defaultFormStateBehavior,\n experimental_customMergeAllOf,\n );\n if (!isObject(rawFormData) || ALL_OF_KEY in schema) {\n // If the formData is not an object which means it's a primitive field, then we need to merge the defaults into the formData.\n // Or if the schema has allOf, we need to merge the defaults into the formData because we don't compute the defaults for allOf.\n defaultsWithFormData = mergeDefaultsWithFormData<T>(\n defaultsWithFormData as T,\n matchingFormData as T,\n mergeExtraDefaults,\n true,\n ) as T;\n }\n }\n\n return defaultsWithFormData;\n}\n\n/**\n * Ensure that the formData matches the given schema. If it's not matching in the case of a selectField, we change it to match the schema.\n *\n * @param validator - an implementation of the `ValidatorType` interface that will be used when necessary\n * @param schema - The schema for which the formData state is desired\n * @param rootSchema - The root schema, used to primarily to look up `$ref`s\n * @param formData - The current formData\n * @param [experimental_defaultFormStateBehavior] - Optional configuration object, if provided, allows users to override default form state behavior\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - valid formData that matches schema\n */\nexport function ensureFormDataMatchingSchema<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n validator: ValidatorType<T, S, F>,\n schema: S,\n rootSchema: S,\n formData: T | undefined,\n experimental_defaultFormStateBehavior?: Experimental_DefaultFormStateBehavior,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): T | T[] | undefined {\n const shouldRetrieveAllOf =\n experimental_defaultFormStateBehavior?.allOf === 'populateDefaults' && ALL_OF_KEY in schema;\n const schemaToMatch = shouldRetrieveAllOf\n ? retrieveSchema<T, S, F>(validator, schema, rootSchema, formData, experimental_customMergeAllOf)\n : schema;\n const isSelectField =\n !isConstant<S>(schemaToMatch) &&\n isSelect<T, S, F>(validator, schemaToMatch, rootSchema, experimental_customMergeAllOf);\n let validFormData: T | T[] | undefined = formData;\n if (isSelectField) {\n const getOptionsList = optionsList<T, S, F>(schemaToMatch);\n const isValid = getOptionsList?.some((option) => deepEquals(option.value, formData));\n validFormData = isValid ? formData : undefined;\n }\n\n // Override the formData with the const if the constAsDefaults is set to always\n const constTakesPrecedence =\n schemaToMatch[CONST_KEY] && experimental_defaultFormStateBehavior?.constAsDefaults === 'always';\n if (constTakesPrecedence) {\n validFormData = schemaToMatch.const as T;\n } else if (isObject(validFormData) && isObject(schemaToMatch.properties)) {\n validFormData = Object.keys(schemaToMatch.properties).reduce(\n (acc: GenericObjectType, key: string) => {\n const propertySchema: S = get(schemaToMatch, [PROPERTIES_KEY, key], {}) as S;\n if (key in acc && (shouldRetrieveAllOf || (isObject(propertySchema) && ALL_OF_KEY in propertySchema))) {\n acc[key] = ensureFormDataMatchingSchema<T, S, F>(\n validator,\n propertySchema,\n rootSchema,\n get(acc, key),\n experimental_defaultFormStateBehavior,\n experimental_customMergeAllOf,\n );\n }\n return acc;\n },\n { ...(validFormData as GenericObjectType) },\n ) as T;\n }\n\n return validFormData;\n}\n\n/** Computes the default value for objects.\n *\n * @param validator - an implementation of the `ValidatorType` interface that will be used when necessary\n * @param rawSchema - The schema for which the default state is desired\n * @param computeDefaultsProps - Optional props for this function\n * @param defaults - Optional props for this function\n * @returns - The default value based on the schema type if they are defined for object or array schemas.\n */\nexport function getObjectDefaults<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n validator: ValidatorType<T, S, F>,\n rawSchema: S,\n {\n rawFormData,\n rootSchema = {} as S,\n includeUndefinedValues = false,\n _recurseList = [],\n experimental_defaultFormStateBehavior,\n experimental_customMergeAllOf,\n required,\n shouldMergeDefaultsIntoFormData,\n initialDefaultsGenerated,\n }: ComputeDefaultsProps<T, S> = {},\n defaults?: T | T[],\n): T {\n {\n const formData: T = (isObject(rawFormData) ? rawFormData : {}) as T;\n const schema: S = rawSchema;\n // Retrieve the schema:\n // - If schema contains `allOf` AND `experimental_defaultFormStateBehavior.allOf` is set to `populateDefaults`\n // - OR if schema contains an 'if' AND `emptyObjectFields` is not set to `skipEmptyDefaults`\n // This ensures we compute defaults correctly for schemas with these keywords.\n const shouldRetrieveSchema =\n (experimental_defaultFormStateBehavior?.allOf === 'populateDefaults' && ALL_OF_KEY in schema) ||\n (experimental_defaultFormStateBehavior?.emptyObjectFields !== 'skipEmptyDefaults' && IF_KEY in schema);\n const retrievedSchema = shouldRetrieveSchema\n ? retrieveSchema<T, S, F>(validator, schema, rootSchema, formData, experimental_customMergeAllOf)\n : schema;\n const parentConst = retrievedSchema[CONST_KEY];\n const objectDefaults = Object.keys(retrievedSchema.properties || {}).reduce(\n (acc: GenericObjectType, key: string) => {\n const propertySchema: S = get(retrievedSchema, [PROPERTIES_KEY, key], {}) as S;\n // Check if the parent schema has a const property defined AND we are supporting const as defaults, then we\n // should always return the computedDefault since it's coming from the const.\n const hasParentConst = isObject(parentConst) && (parentConst as JSONSchema7Object)[key] !== undefined;\n const hasConst =\n ((isObject(propertySchema) && CONST_KEY in propertySchema) || hasParentConst) &&\n experimental_defaultFormStateBehavior?.constAsDefaults !== 'never' &&\n !constIsAjvDataReference(propertySchema);\n // Compute the defaults for this node, with the parent defaults we might\n // have from a previous run: defaults[key].\n const computedDefault = computeDefaults<T, S, F>(validator, propertySchema, {\n rootSchema,\n _recurseList,\n experimental_defaultFormStateBehavior,\n experimental_customMergeAllOf,\n includeUndefinedValues: includeUndefinedValues === true,\n parentDefaults: get(defaults, [key]),\n rawFormData: get(formData, [key]),\n required: retrievedSchema.required?.includes(key),\n shouldMergeDefaultsIntoFormData,\n initialDefaultsGenerated,\n });\n\n maybeAddDefaultToObject<T>(\n acc,\n key,\n computedDefault,\n includeUndefinedValues,\n required,\n retrievedSchema.required,\n experimental_defaultFormStateBehavior,\n hasConst,\n propertySchema?.type === 'null',\n );\n\n return acc;\n },\n {},\n ) as T;\n if (retrievedSchema.additionalProperties && !initialDefaultsGenerated) {\n // as per spec additionalProperties may be either schema or boolean\n const additionalPropertiesSchema = isObject(retrievedSchema.additionalProperties)\n ? retrievedSchema.additionalProperties\n : {};\n\n const keys = new Set<string>();\n const formDataRequired: string[] = [];\n Object.keys(formData as GenericObjectType)\n .filter((key) => !retrievedSchema.properties || !retrievedSchema.properties[key])\n .forEach((key) => {\n keys.add(key);\n formDataRequired.push(key);\n });\n // Only seed keys from schema defaults when formData has no additionalProperties of its own.\n // If the user already has data (e.g. after a key rename), injecting default keys would\n // re-add stale entries that no longer exist in formData.\n if (isObject(defaults) && formDataRequired.length === 0) {\n Object.keys(defaults as GenericObjectType)\n .filter((key) => !retrievedSchema.properties || !retrievedSchema.properties[key])\n .forEach((key) => keys.add(key));\n }\n keys.forEach((key) => {\n const computedDefault = computeDefaults(validator, additionalPropertiesSchema as S, {\n rootSchema,\n _recurseList,\n experimental_defaultFormStateBehavior,\n experimental_customMergeAllOf,\n includeUndefinedValues: includeUndefinedValues === true,\n parentDefaults: get(defaults, [key]),\n rawFormData: get(formData, [key]),\n required: retrievedSchema.required?.includes(key),\n shouldMergeDefaultsIntoFormData,\n initialDefaultsGenerated,\n });\n // Since these are additional properties we don't need to add the `experimental_defaultFormStateBehavior` prop\n maybeAddDefaultToObject<T>(\n objectDefaults as GenericObjectType,\n key,\n computedDefault,\n includeUndefinedValues,\n required,\n formDataRequired,\n );\n });\n }\n return computeDefaultBasedOnSchemaTypeAndDefaults<T, S>(rawSchema, objectDefaults);\n }\n}\n\n/** Computes the default value for arrays.\n *\n * @param validator - an implementation of the `ValidatorType` interface that will be used when necessary\n * @param rawSchema - The schema for which the default state is desired\n * @param computeDefaultsProps - Optional props for this function\n * @param initialDefaults - Optional props for this function\n * @returns - The default value based on the schema type if they are defined for object or array schemas.\n */\nexport function getArrayDefaults<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n validator: ValidatorType<T, S, F>,\n rawSchema: S,\n {\n rawFormData,\n rootSchema = {} as S,\n _recurseList = [],\n experimental_defaultFormStateBehavior,\n experimental_customMergeAllOf,\n required,\n requiredAsRoot = false,\n shouldMergeDefaultsIntoFormData,\n initialDefaultsGenerated,\n }: ComputeDefaultsProps<T, S> = {},\n initialDefaults?: T[],\n): T[] | undefined {\n let defaults = initialDefaults;\n const schema: S = rawSchema;\n\n const arrayMinItemsStateBehavior = experimental_defaultFormStateBehavior?.arrayMinItems ?? {};\n const { populate: arrayMinItemsPopulate, mergeExtraDefaults: arrayMergeExtraDefaults } = arrayMinItemsStateBehavior;\n\n const neverPopulate = arrayMinItemsPopulate === 'never';\n const ignoreMinItemsFlagSet = arrayMinItemsPopulate === 'requiredOnly';\n const isPopulateAll = arrayMinItemsPopulate === 'all' || (!neverPopulate && !ignoreMinItemsFlagSet);\n const computeSkipPopulate = arrayMinItemsStateBehavior?.computeSkipPopulate ?? (() => false);\n const isSkipEmptyDefaults = experimental_defaultFormStateBehavior?.emptyObjectFields === 'skipEmptyDefaults';\n\n const emptyDefault: T[] | undefined = isSkipEmptyDefaults ? undefined : [];\n\n // Inject defaults into existing array defaults\n if (Array.isArray(defaults)) {\n defaults = defaults.map((item, idx) => {\n const schemaItem: S = getInnerSchemaForArrayItem<S>(schema, AdditionalItemsHandling.Fallback, idx);\n const itemFormData = Array.isArray(rawFormData) ? rawFormData[idx] : undefined;\n return computeDefaults<T, S, F>(validator, schemaItem, {\n rootSchema,\n _recurseList,\n experimental_defaultFormStateBehavior,\n experimental_customMergeAllOf,\n parentDefaults: item,\n rawFormData: itemFormData,\n required,\n shouldMergeDefaultsIntoFormData,\n initialDefaultsGenerated,\n });\n }) as T[];\n }\n\n // Deeply inject defaults into already existing form data\n if (Array.isArray(rawFormData)) {\n const schemaItem: S = getInnerSchemaForArrayItem<S>(schema);\n if (neverPopulate) {\n defaults = rawFormData as typeof defaults;\n } else {\n const itemDefaults = rawFormData.map((item: T, idx: number) =>\n computeDefaults<T, S, F>(validator, schemaItem, {\n rootSchema,\n _recurseList,\n experimental_defaultFormStateBehavior,\n experimental_customMergeAllOf,\n rawFormData: item,\n parentDefaults: get(defaults, [idx]),\n required,\n shouldMergeDefaultsIntoFormData,\n initialDefaultsGenerated,\n }),\n ) as T[];\n\n // If the populate 'requiredOnly' flag is set then we only merge and include extra defaults if they are required.\n // Or if populate 'all' is set we merge and include extra defaults.\n const mergeExtraDefaults = ((ignoreMinItemsFlagSet && required) || isPopulateAll) && arrayMergeExtraDefaults;\n defaults = mergeDefaultsWithFormData(defaults, itemDefaults, mergeExtraDefaults);\n }\n }\n\n const defaultsLength = Array.isArray(defaults) ? defaults.length : 0;\n\n if (neverPopulate) {\n if (shouldMergeDefaultsIntoFormData && !required) {\n // Optional arrays with no existing data should be omitted entirely rather than defaulted to `[]`.\n // Required arrays still fall through to `defaults ?? emptyDefault` below so that `[]` is surfaced,\n // letting the validator report `minItems` violations instead of a missing-required-property error.\n return defaults;\n }\n return defaults ?? emptyDefault;\n }\n if (ignoreMinItemsFlagSet && !required) {\n // If no form data exists or defaults are set leave the field empty/non-existent, otherwise\n // return form data/defaults\n return defaults || undefined;\n }\n\n let arrayDefault: T[] | undefined;\n if (\n !schema.minItems ||\n isMultiSelect<T, S, F>(validator, schema, rootSchema, experimental_customMergeAllOf) ||\n computeSkipPopulate<T, S, F>(validator, schema, rootSchema) ||\n schema.minItems <= defaultsLength\n ) {\n // we don't want undefined defaults unless it is both not required or not required as root\n arrayDefault = defaults || (!required && !requiredAsRoot) ? defaults : emptyDefault;\n } else {\n const defaultEntries: T[] = defaults || [];\n const fillerSchema: S = getInnerSchemaForArrayItem<S>(schema, AdditionalItemsHandling.Invert);\n const fillerDefault = fillerSchema.default;\n\n // Calculate filler entries for remaining items (minItems - existing raw data/defaults)\n const fillerEntries: T[] = Array.from({ length: schema.minItems - defaultsLength }, () =>\n computeDefaults<any, S, F>(validator, fillerSchema, {\n parentDefaults: fillerDefault,\n rootSchema,\n _recurseList,\n experimental_defaultFormStateBehavior,\n experimental_customMergeAllOf,\n required,\n shouldMergeDefaultsIntoFormData,\n }),\n ) as T[];\n // then fill up the rest with either the item default or empty, up to minItems\n arrayDefault = defaultEntries.concat(fillerEntries);\n }\n\n return computeDefaultBasedOnSchemaTypeAndDefaults<T[] | undefined, S>(rawSchema, arrayDefault);\n}\n\n/** Computes the default value based on the schema type.\n *\n * @param validator - an implementation of the `ValidatorType` interface that will be used when necessary\n * @param rawSchema - The schema for which the default state is desired\n * @param computeDefaultsProps - Optional props for this function\n * @param defaults - Optional props for this function\n * @returns - The default value based on the schema type if they are defined for object or array schemas.\n */\nexport function getDefaultBasedOnSchemaType<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n validator: ValidatorType<T, S, F>,\n rawSchema: S,\n computeDefaultsProps: ComputeDefaultsProps<T, S> = {},\n defaults?: T | T[],\n): T | T[] | undefined {\n switch (getSchemaType<S>(rawSchema)) {\n // We need to recurse for object schema inner default values.\n case 'object': {\n return getObjectDefaults(validator, rawSchema, computeDefaultsProps, defaults);\n }\n case 'array': {\n return getArrayDefaults(validator, rawSchema, computeDefaultsProps, defaults as T[]);\n }\n default:\n return undefined;\n }\n}\n\n/** Returns the superset of `formData` that includes the given set updated to include any missing fields that have\n * computed to have defaults provided in the `schema`.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be used when necessary\n * @param theSchema - The schema for which the default state is desired\n * @param [formData] - The current formData, if any, onto which to provide any missing defaults\n * @param [rootSchema] - The root schema, used to primarily to look up `$ref`s\n * @param [includeUndefinedValues=false] - Optional flag, if true, cause undefined values to be added as defaults.\n * If \"excludeObjectChildren\", cause undefined values for this object and pass `includeUndefinedValues` as\n * false when computing defaults for any nested object properties.\n * @param [experimental_defaultFormStateBehavior] Optional configuration object, if provided, allows users to override default form state behavior\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @param initialDefaultsGenerated - Optional flag, indicates whether or not initial defaults have been generated\n * @returns - The resulting `formData` with all the defaults provided\n */\nexport default function getDefaultFormState<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n validator: ValidatorType<T, S, F>,\n theSchema: S,\n formData?: T,\n rootSchema?: S,\n includeUndefinedValues: boolean | 'excludeObjectChildren' = false,\n experimental_defaultFormStateBehavior?: Experimental_DefaultFormStateBehavior,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n initialDefaultsGenerated?: boolean,\n) {\n if (!isObject(theSchema)) {\n throw new Error(`Invalid schema: ${theSchema}`);\n }\n const schema = retrieveSchema<T, S, F>(validator, theSchema, rootSchema, formData, experimental_customMergeAllOf);\n\n // Get the computed defaults with 'shouldMergeDefaultsIntoFormData' set to true to merge defaults into formData.\n // This is done when for example the value from formData does not exist in the schema 'enum' property, in such\n // cases we take the value from the defaults because the value from the formData is not valid.\n const defaults = computeDefaults<T, S, F>(validator, schema, {\n rootSchema,\n includeUndefinedValues,\n experimental_defaultFormStateBehavior,\n experimental_customMergeAllOf,\n rawFormData: formData,\n shouldMergeDefaultsIntoFormData: true,\n initialDefaultsGenerated,\n requiredAsRoot: true,\n });\n\n if (schema.type !== 'object' && isObject(schema.default)) {\n return {\n ...defaults,\n ...formData,\n } as T;\n }\n\n // If the formData is an object or an array, add additional properties from formData and override formData with\n // defaults since the defaults are already merged with formData.\n if (isObject(formData) || Array.isArray(formData)) {\n const { mergeDefaultsIntoFormData } = experimental_defaultFormStateBehavior || {};\n const defaultSupercedesUndefined = mergeDefaultsIntoFormData === 'useDefaultIfFormDataUndefined';\n const matchingFormData = ensureFormDataMatchingSchema<T, S, F>(\n validator,\n schema,\n rootSchema ?? schema,\n formData,\n experimental_defaultFormStateBehavior,\n experimental_customMergeAllOf,\n );\n const result = mergeDefaultsWithFormData<T | T[]>(\n defaults,\n matchingFormData,\n true, // set to true to add any additional default array entries.\n defaultSupercedesUndefined,\n true, // set to true to override formData with defaults if they exist.\n );\n return result;\n }\n\n return defaults;\n}\n", "import getUiOptions from './getUiOptions';\nimport type { FormContextType, RJSFSchema, StrictRJSFSchema, UiSchema } from './types';\n\n/** Checks to see if the `uiSchema` contains the `widget` field and that the widget is not `hidden`\n *\n * @param uiSchema - The UI Schema from which to detect if it is customized\n * @returns - True if the `uiSchema` describes a custom widget, false otherwise\n */\nexport default function isCustomWidget<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(uiSchema: UiSchema<T, S, F> = {}) {\n return (\n // TODO: Remove the `&& uiSchema['ui:widget'] !== 'hidden'` once we support hidden widgets for arrays.\n // https://rjsf-team.github.io/react-jsonschema-form/docs/usage/widgets/#hidden-widgets\n 'widget' in getUiOptions<T, S, F>(uiSchema) && getUiOptions<T, S, F>(uiSchema).widget !== 'hidden'\n );\n}\n", "import { UI_WIDGET_KEY } from '../constants';\nimport type {\n Experimental_CustomMergeAllOf,\n FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n UiSchema,\n ValidatorType,\n} from '../types';\nimport retrieveSchema from './retrieveSchema';\n\n/** Checks to see if the `schema` and `uiSchema` combination represents an array of files\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be used when necessary\n * @param schema - The schema for which check for array of files flag is desired\n * @param [uiSchema={}] - The UI schema from which to check the widget\n * @param [rootSchema] - The root schema, used to primarily to look up `$ref`s\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - True if schema/uiSchema contains an array of files, otherwise false\n */\nexport default function isFilesArray<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n validator: ValidatorType<T, S, F>,\n schema: S,\n uiSchema: UiSchema<T, S, F> = {},\n rootSchema?: S,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n) {\n if (uiSchema[UI_WIDGET_KEY] === 'files') {\n return true;\n }\n if (schema.items) {\n const itemsSchema = retrieveSchema<T, S, F>(\n validator,\n schema.items as S,\n rootSchema,\n undefined,\n experimental_customMergeAllOf,\n );\n return itemsSchema.type === 'string' && itemsSchema.format === 'data-url';\n }\n return false;\n}\n", "import { ADDITIONAL_PROPERTY_FLAG, UI_FIELD_KEY, UI_WIDGET_KEY } from '../constants';\nimport getSchemaType from '../getSchemaType';\nimport getUiOptions from '../getUiOptions';\nimport isCustomWidget from '../isCustomWidget';\nimport type {\n FormContextType,\n GlobalUISchemaOptions,\n RJSFMarkedSchema,\n RJSFSchema,\n StrictRJSFSchema,\n UiSchema,\n ValidatorType,\n Experimental_CustomMergeAllOf,\n} from '../types';\nimport isFilesArray from './isFilesArray';\nimport isMultiSelect from './isMultiSelect';\n\n/** Determines whether the combination of `schema` and `uiSchema` properties indicates that the label for the `schema`\n * should be displayed in a UI.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be used when necessary\n * @param schema - The schema for which the display label flag is desired\n * @param [uiSchema={}] - The UI schema from which to derive potentially displayable information\n * @param [rootSchema] - The root schema, used to primarily to look up `$ref`s\n * @param [globalOptions={}] - The optional Global UI Schema from which to get any fallback `xxx` options\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - True if the label should be displayed or false if it should not\n */\nexport default function getDisplayLabel<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n validator: ValidatorType<T, S, F>,\n schema: S,\n uiSchema: UiSchema<T, S, F> = {},\n rootSchema?: S,\n globalOptions?: GlobalUISchemaOptions,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): boolean {\n const uiOptions = getUiOptions<T, S, F>(uiSchema, globalOptions);\n const { label = true } = uiOptions;\n let displayLabel = Boolean(label);\n if (displayLabel) {\n const schemaType = getSchemaType<S>(schema);\n const addedByAdditionalProperty = Boolean((schema as RJSFMarkedSchema)[ADDITIONAL_PROPERTY_FLAG]);\n\n if (schemaType === 'array') {\n displayLabel =\n addedByAdditionalProperty ||\n isMultiSelect<T, S, F>(validator, schema, rootSchema, experimental_customMergeAllOf) ||\n isFilesArray<T, S, F>(validator, schema, uiSchema, rootSchema, experimental_customMergeAllOf) ||\n isCustomWidget(uiSchema);\n }\n\n if (schemaType === 'object') {\n displayLabel = addedByAdditionalProperty;\n }\n if (schemaType === 'boolean' && uiSchema && !uiSchema[UI_WIDGET_KEY]) {\n displayLabel = false;\n }\n if (uiSchema?.[UI_FIELD_KEY]) {\n displayLabel = false;\n }\n }\n return displayLabel;\n}\n", "import baseGet from './_baseGet.js';\nimport baseSet from './_baseSet.js';\nimport castPath from './_castPath.js';\n\n/**\n * The base implementation of `_.pickBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @param {Function} predicate The function invoked per property.\n * @returns {Object} Returns the new object.\n */\nfunction basePickBy(object, paths, predicate) {\n var index = -1,\n length = paths.length,\n result = {};\n\n while (++index < length) {\n var path = paths[index],\n value = baseGet(object, path);\n\n if (predicate(value, path)) {\n baseSet(result, castPath(path, object), value);\n }\n }\n return result;\n}\n\nexport default basePickBy;\n", "import basePickBy from './_basePickBy.js';\nimport hasIn from './hasIn.js';\n\n/**\n * The base implementation of `_.pick` without support for individual\n * property identifiers.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @returns {Object} Returns the new object.\n */\nfunction basePick(object, paths) {\n return basePickBy(object, paths, function(value, path) {\n return hasIn(object, path);\n });\n}\n\nexport default basePick;\n", "import basePick from './_basePick.js';\nimport flatRest from './_flatRest.js';\n\n/**\n * Creates an object composed of the picked `object` properties.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pick(object, ['a', 'c']);\n * // => { 'a': 1, 'c': 3 }\n */\nvar pick = flatRest(function(object, paths) {\n return object == null ? {} : basePick(object, paths);\n});\n\nexport default pick;\n", "import get from 'lodash/get';\nimport isEmpty from 'lodash/isEmpty';\nimport isNil from 'lodash/isNil';\nimport pick from 'lodash/pick';\n\nimport { NAME_KEY, RJSF_ADDITIONAL_PROPERTIES_FLAG } from '../constants';\nimport findSchemaDefinition from '../findSchemaDefinition';\nimport getDiscriminatorFieldFromSchema from '../getDiscriminatorFieldFromSchema';\nimport getSchemaType from '../getSchemaType';\nimport isObject from '../isObject';\nimport type {\n Experimental_CustomMergeAllOf,\n FormContextType,\n GenericObjectType,\n PathSchema,\n RJSFSchema,\n StrictRJSFSchema,\n ValidatorType,\n} from '../types';\nimport getClosestMatchingOption from './getClosestMatchingOption';\nimport isSelect from './isSelect';\nimport { relaxOptionsForScoring, resolveAllReferences } from './retrieveSchema';\nimport shallowAllOfMerge from './shallowAllOfMerge';\n\n/** Returns the `formData` with only the elements specified in the `fields` list\n *\n * @param formData - The data for the `Form`\n * @param fields - The fields to keep while filtering\n * @deprecated - To be removed as an exported `@rjsf/utils` function in a future release\n */\nexport function getUsedFormData<T = any>(formData: T | undefined, fields: string[]): T | undefined {\n // For the case of a single input form\n if (fields.length === 0 && typeof formData !== 'object') {\n return formData;\n }\n\n const data: GenericObjectType = pick(formData, fields);\n if (Array.isArray(formData)) {\n return Object.keys(data).map((key: string) => data[key]) as unknown as T;\n }\n\n return data as T;\n}\n\n/** Returns the list of field names from inspecting the `pathSchema` as well as using the `formData`\n *\n * @param pathSchema - The `PathSchema` object for the form\n * @param [formData] - The form data to use while checking for empty objects/arrays\n * @deprecated - To be removed as an exported `@rjsf/utils` function in a future release\n */\n// oxlint-disable-next-line typescript/no-deprecated\nexport function getFieldNames<T = any>(pathSchema: PathSchema<T>, formData?: T): string[][] {\n const formValueHasData = (value: T, isLeaf: boolean) =>\n typeof value !== 'object' || isEmpty(value) || (isLeaf && !isEmpty(value));\n const getAllPaths = (_obj: GenericObjectType, acc: string[][] = [], paths: string[][] = [[]]) => {\n const objKeys = Object.keys(_obj);\n objKeys.forEach((key: string) => {\n const data = _obj[key];\n if (typeof data === 'object') {\n const newPaths = paths.map((path) => [...path, key]);\n // If an object is marked with additionalProperties, all its keys are valid\n if (data[RJSF_ADDITIONAL_PROPERTIES_FLAG] && data[NAME_KEY] !== '') {\n acc.push(data[NAME_KEY]);\n } else {\n getAllPaths(data, acc, newPaths);\n }\n } else if (key === NAME_KEY && data !== '') {\n paths.forEach((path) => {\n const formValue = get(formData, path);\n const isLeaf = objKeys.length === 1;\n // adds path to fieldNames if it points to a value or an empty object/array which is not a leaf\n if (\n formValueHasData(formValue, isLeaf) ||\n (Array.isArray(formValue) && formValue.every((val) => formValueHasData(val, isLeaf)))\n ) {\n acc.push(path);\n }\n });\n }\n });\n return acc;\n };\n\n return getAllPaths(pathSchema);\n}\n\n/** Returns true when a form value is considered empty: null/undefined/'', an empty array, or a plain\n * object whose every own value is itself empty (recursive). Scalars like `0` and `false` are not empty.\n *\n * @param value - The value to check\n * @returns - True if the value is considered empty, false otherwise\n */\nexport function isValueEmpty(value: unknown): boolean {\n if (isNil(value) || value === '') {\n return true;\n }\n if (Array.isArray(value)) {\n return value.length === 0;\n }\n if (isObject(value)) {\n return Object.values(value as GenericObjectType).every(isValueEmpty);\n }\n return false;\n}\n\n/** Merges an `allOf` schema into a single flat schema, delegating to `experimental_customMergeAllOf`\n * when provided or falling back to the module-level `shallowAllOfMerge` otherwise.\n *\n * @param schema - A schema containing an `allOf` array to be merged\n * @param [experimental_customMergeAllOf] - Optional custom merge function; see `Form` documentation\n * @returns - The merged schema with `allOf` resolved into a single schema object\n */\nfunction doMergeAllOf<S extends StrictRJSFSchema = RJSFSchema>(\n schema: S,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): S {\n return experimental_customMergeAllOf ? experimental_customMergeAllOf(schema) : (shallowAllOfMerge(schema) as S);\n}\n\n/** A recursive, schema-driven filter that walks `schema` and `formData` in lockstep, keeping only\n * values that are described by the schema. Handles `$ref`, `allOf`, `anyOf`, `oneOf`, `if/then/else`,\n * `patternProperties`, `additionalProperties`, `propertyNames`, and `dependencies`. Optional object\n * properties whose schema-filtered content is entirely empty (per `isValueEmpty`) are pruned; required\n * properties and scalar values are always kept when schema-defined.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be used when necessary\n * @param schema - The schema for which to filter the formData\n * @param [rootSchema] - The root schema, used primarily to look up `$ref`s\n * @param [formData] - The data for the `Form`\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - The `formData` after omitting extra data, or `undefined` when `formData` is undefined\n */\nexport default function omitExtraData<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n validator: ValidatorType<T, S, F>,\n schema: S,\n rootSchema: S = {} as S,\n formData?: T,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): T | undefined {\n /** Type predicate that narrows `value` to `GenericObjectType` — true when `value` is a plain,\n * non-array object (i.e. a JSON object). Used to distinguish JSON objects from arrays and primitives.\n *\n * @param value - The value to check\n * @returns - True if `value` is a plain non-array object\n */\n function isObjectValue(value: unknown): value is GenericObjectType {\n return isObject(value);\n }\n\n /** Type predicate that narrows a `S | boolean` schema definition to `S` — true when `schemaDef` is\n * a schema object rather than a JSON Schema boolean shorthand (`true` meaning allow-all, `false`\n * meaning deny-all).\n *\n * @param schemaDef - The schema definition to check\n * @returns - True if `schemaDef` is a schema object\n */\n function isSchemaObj(schemaDef: S | boolean): schemaDef is S {\n return isObject(schemaDef);\n }\n\n /** Copies schema-defined properties from `source` into `target`, applying `omit` recursively for\n * each value. Handles `properties`, `patternProperties`, `additionalProperties`, and `propertyNames`.\n * Optional object-valued properties are pruned when every key in the filtered result is both\n * optional (per the inner schema's `required`) and empty (per `isValueEmpty`). This preserves\n * optional objects whose required children have empty values, while still dropping objects whose\n * schema-filtered content is entirely optional-and-empty. Required properties and scalar values\n * are always written when defined. Always returns `target` — pruning of the object itself is\n * the caller's responsibility.\n *\n * @param childSchema - The object schema describing which properties are allowed\n * @param source - The source form data object to read values from\n * @param target - The accumulator object to write filtered values into\n * @returns - `target` after all schema-defined properties have been processed\n */\n function handleObject(childSchema: S, source: GenericObjectType, target: GenericObjectType): GenericObjectType {\n const { properties, additionalProperties, patternProperties, propertyNames } = childSchema;\n const requiredSet = new Set(childSchema.required ?? []);\n\n /** Recursively omits extra data from `value` via `omit`, then conditionally writes the result to\n * `target[key]`. Optional object-valued properties are dropped when every key in the filtered\n * result is both optional (within the inner schema's `required` list) and has an empty value per\n * `isValueEmpty`. This per-key approach prevents required-but-empty child properties — kept by\n * inner `setProperty` calls — from inadvertently causing the parent optional object to be dropped,\n * while still pruning optional objects whose schema-filtered content is entirely empty. Vacuously\n * true for `{}`, so empty results are always dropped. Scalar and array values are not pruned here.\n *\n * @param key - The property key to write on `target`\n * @param schemaDef - The schema (or boolean shorthand) that governs the value at `key`\n * @param value - The raw source value to filter\n * @param [required=false] - When true the property is never pruned regardless of its filtered value\n */\n function setProperty(key: string, schemaDef: S | boolean, value: unknown, required = false) {\n const v = omit(schemaDef, value, target[key]);\n if (!required && isObject(v)) {\n // Resolve $ref so we can inspect the effective required list for the inner schema.\n let sd = isSchemaObj(schemaDef) ? schemaDef : ({} as S);\n if (sd.$ref !== undefined) {\n sd = findSchemaDefinition<S>(sd.$ref, rootSchema);\n }\n const innerRequired = new Set(sd.required ?? []);\n // Drop this optional object when every key in v is both optional in the inner schema\n // and has an empty value. Vacuously true for {} so empty objects are always dropped.\n const shouldDrop = Object.entries(v as GenericObjectType).every(\n ([k, val]) => !innerRequired.has(k) && isValueEmpty(val),\n );\n if (shouldDrop) {\n return;\n }\n }\n if (v !== undefined) {\n // oxlint-disable-next-line no-param-reassign\n target[key] = v;\n }\n }\n\n if (properties !== undefined) {\n for (const [key, schemaDef] of Object.entries(properties)) {\n setProperty(key, schemaDef as S | boolean, source[key], requiredSet.has(key));\n }\n }\n\n // Track keys not handled by properties/patterns so additionalProperties can pick them up.\n let patternPropertiesRest: string[] | undefined;\n if (patternProperties !== undefined) {\n patternPropertiesRest = [];\n const patterns = Object.entries(patternProperties).map(([pattern, schemaDef]): [RegExp, S | boolean] => [\n new RegExp(pattern),\n schemaDef as S | boolean,\n ]);\n const knownProperties = new Set(Object.keys(properties ?? {}));\n for (const [key, value] of Object.entries(source)) {\n if (!knownProperties.has(key)) {\n const matched = patterns.find(([re]) => re.test(key));\n if (matched === undefined) {\n patternPropertiesRest.push(key);\n } else {\n setProperty(key, matched[1], value);\n }\n }\n }\n }\n\n // JSON Schema spec: absent additionalProperties defaults to true (allow all extra keys). Here\n // we treat it as false so omitExtraData never inadvertently passes through undescribed keys.\n if (additionalProperties !== undefined && additionalProperties !== false) {\n const addlSchema = additionalProperties as S | boolean;\n if (patternPropertiesRest !== undefined) {\n for (const key of patternPropertiesRest) {\n setProperty(key, addlSchema, source[key]);\n }\n } else {\n const knownProperties = new Set(Object.keys(properties ?? {}));\n for (const [key, value] of Object.entries(source)) {\n if (!knownProperties.has(key)) {\n setProperty(key, addlSchema, value);\n }\n }\n }\n }\n\n // When propertyNames is present, the schema only constrains key names — all source keys are valid.\n if (propertyNames !== undefined) {\n for (const [key, value] of Object.entries(source)) {\n // oxlint-disable-next-line no-param-reassign\n target[key] = value;\n }\n }\n\n return target;\n }\n\n /** Filters array elements from `source` into `target` according to `schema.items` and\n * `schema.additionalItems`. For tuple schemas (`items` is an array) each element is filtered by its\n * per-index schema; elements beyond the tuple length are covered by `additionalItems` when present.\n * For list schemas (`items` is a single schema) every element is filtered by that schema.\n *\n * @param childSchema - The array schema describing `items` and optionally `additionalItems`\n * @param source - The source array to read elements from\n * @param target - The accumulator array to push filtered elements into\n * @returns - `target` after all applicable source elements have been pushed\n */\n function handleArray(childSchema: S, source: unknown[], target: unknown[]): unknown[] {\n const { items, additionalItems } = childSchema;\n if (items !== undefined) {\n if (Array.isArray(items)) {\n for (let i = 0; i < items.length; i += 1) {\n target.push(omit(items[i] as S | boolean, source[i]));\n }\n } else {\n for (let i = 0; i < source.length; i += 1) {\n target.push(omit(items as S | boolean, source[i]));\n }\n }\n }\n // additionalItems covers tuple items beyond the items array length.\n if (additionalItems) {\n for (let i = target.length; i < source.length; i += 1) {\n target.push(omit(additionalItems as S | boolean, source[i]));\n }\n }\n return target;\n }\n\n /** Applies the `if/then/else` conditional keywords from `schema` to `target`. When `schema.if` is\n * absent the original `target` is returned unchanged. Otherwise the condition is evaluated — using\n * `validator.isValid` for schema conditions or the boolean value directly — and the matching branch\n * (`then` or `else`) is applied via `omit`. When the selected branch is absent, `target` is returned\n * unchanged.\n *\n * @param childSchema - The schema potentially containing `if`, `then`, and `else` keywords\n * @param source - The current form data value, passed to `validator.isValid` and the branch `omit`\n * @param target - The already-filtered value to merge the branch result into\n * @returns - The result of applying the matched branch, or `target` when no branch applies\n */\n function handleConditions(childSchema: S, source: unknown, target: unknown): unknown {\n const { if: condition, then, else: otherwise } = childSchema;\n if (condition === undefined) {\n return target;\n }\n // validator.isValid signature: (schema, formData, rootSchema)\n const isThenBranch = isSchemaObj(condition as S | boolean)\n ? validator.isValid(condition as S, source as T, rootSchema)\n : condition;\n const branch = isThenBranch ? then : otherwise;\n return branch === undefined ? target : omit(branch as S | boolean, source, target);\n }\n\n /** Applies the best-matching `oneOf` option to `source`, merging the result into `target`. When\n * `oneOf` is not an array or the schema represents a select widget (enum-driven), `target` is\n * returned unchanged. `additionalProperties: false` is relaxed on each option before scoring so that\n * `getClosestMatchingOption` can validate freely, but the original option schema is used for the\n * actual `omit` call.\n *\n * @param oneOf - The `oneOf` array from the schema, or `undefined`\n * @param childSchema - The parent schema containing the `oneOf` keyword\n * @param source - The current form data value used to score each option\n * @param target - The already-filtered value to merge the winning option's result into\n * @returns - The result of applying the best-matching option, or `target` when no matching applies\n */\n function handleOneOf(oneOf: S['oneOf'], childSchema: S, source: unknown, target: unknown): unknown {\n if (!Array.isArray(oneOf) || isSelect(validator, childSchema, rootSchema, experimental_customMergeAllOf)) {\n return target;\n }\n // Resolve $refs and relax additionalProperties:false → true in one pass for scoring only.\n // The unrelaxed resolved schema is re-derived for the winning option so that omit() still\n // respects additionalProperties:false during filtering.\n const scoringOptions = relaxOptionsForScoring<S>(oneOf as (S | boolean)[], true, rootSchema);\n const bestIndex = getClosestMatchingOption<T, S, F>(\n validator,\n rootSchema,\n source as T,\n scoringOptions,\n 0,\n getDiscriminatorFieldFromSchema<S>(childSchema),\n experimental_customMergeAllOf,\n );\n const winning = (oneOf as (S | boolean)[])[bestIndex];\n // For object options, re-resolve without relaxation so additionalProperties:false is respected.\n // For boolean options, scoringOptions already holds the converted schema (true→{}, false→{not:{}}).\n const resolved: S = isObject(winning)\n ? resolveAllReferences<S>(winning, rootSchema, [])\n : scoringOptions[bestIndex];\n return omit(resolved, source, target);\n }\n\n /** Applies `anyOf` branches from `schema` to `source`, merging results into `target`. When `anyOf`\n * is absent or not an array, `target` is returned unchanged. For undefined or empty sources (so that\n * defaults can flow through all branches) every branch is applied in sequence. For non-empty sources\n * the best-matching branch is selected via `handleOneOf`.\n *\n * @param childSchema - The schema potentially containing an `anyOf` keyword\n * @param source - The current form data value; empty or undefined triggers all-branch application\n * @param target - The already-filtered value to merge branch results into\n * @returns - The result after applying the relevant `anyOf` branch(es), or `target` when inapplicable\n */\n function handleAnyOf(childSchema: S, source: unknown, target: unknown): unknown {\n const { anyOf } = childSchema;\n if (!Array.isArray(anyOf)) {\n return target;\n }\n // For undefined or empty collections, apply every branch so defaults flow through.\n if (\n source === undefined ||\n (Array.isArray(source) && source.length === 0) ||\n (isObject(source) && Object.keys(source).length === 0)\n ) {\n let result = target;\n for (const branch of anyOf as (S | boolean)[]) {\n result = omit(branch, source, result);\n }\n return result;\n }\n return handleOneOf(anyOf, childSchema, source, target);\n }\n\n /** Applies schema-based `dependencies` from `schema` to `source`, merging each active dependency's\n * schema into `target` via `omit`. Property dependencies (plain string arrays) are skipped — only\n * schema dependencies are processed. A dependency is considered active when its trigger key is\n * present on `source`.\n *\n * @param childSchema - The schema potentially containing a `dependencies` keyword\n * @param source - The current form data value; must be a plain object for dependencies to apply\n * @param target - The already-filtered value to merge dependency results into\n * @returns - The result after applying all active schema dependencies, or `target` when inapplicable\n */\n function handleDependencies(childSchema: S, source: unknown, target: unknown): unknown {\n const { dependencies } = childSchema;\n if (dependencies === undefined || !isObjectValue(source)) {\n return target;\n }\n let result = target;\n for (const [key, deps] of Object.entries(dependencies)) {\n // Skip property dependencies (string arrays); only process schema dependencies.\n if (key in source && !Array.isArray(deps)) {\n result = omit(deps as S | boolean, source, result);\n }\n }\n return result;\n }\n\n /** Core recursive filter. Resolves `$ref`s, merges `allOf`, then delegates to the type-specific\n * handlers (`handleObject`, `handleArray`) and keyword handlers (`handleAnyOf`, `handleOneOf`,\n * `handleConditions`, `handleDependencies`). Returns `undefined` when `source` is undefined or\n * `schemaDef` is `false`; returns `source` unchanged when `schemaDef` is `true` or empty.\n *\n * @param schemaDef - The schema (or boolean shorthand) to filter `source` against\n * @param source - The raw form data value to filter\n * @param [target] - An optional accumulator carrying results from prior oneOf/anyOf processing\n * @returns - The filtered value, or `undefined` when the schema rejects the value\n */\n function omit(schemaDef: S | boolean, source: unknown, target?: unknown): unknown {\n if (source === undefined || schemaDef === false) {\n return undefined;\n }\n if (schemaDef === true || isEmpty(schemaDef as object)) {\n return source;\n }\n\n let localSchema = schemaDef;\n const { $ref: ref, allOf } = localSchema;\n\n if (ref !== undefined) {\n return omit(findSchemaDefinition<S>(ref, rootSchema), source, target);\n }\n if (allOf) {\n localSchema = doMergeAllOf<S>(localSchema, experimental_customMergeAllOf);\n // Schemas whose allOf entries contain if/then/else keywords may not fully merge: the merger\n // can only hoist one if/then/else triple to the parent level, so additional entries stay in\n // allOf. Process any that remain so their conditional properties are not silently dropped.\n // See: https://github.com/rjsf-team/react-jsonschema-form/issues/5142\n const remainingAllOf = localSchema.allOf;\n if (remainingAllOf) {\n for (let i = 0; i < remainingAllOf.length; i++) {\n // oxlint-disable-next-line no-param-reassign\n target = omit(remainingAllOf[i] as S | boolean, source, target);\n }\n }\n }\n\n let filtered = handleAnyOf(localSchema, source, handleOneOf(localSchema.oneOf, localSchema, source, target));\n\n const type = getSchemaType<S>(localSchema);\n if (type === 'object') {\n if (!isObjectValue(source)) {\n return undefined;\n }\n filtered = handleObject(localSchema, source, isObjectValue(filtered) ? filtered : {});\n } else if (type === 'array') {\n if (!Array.isArray(source)) {\n return undefined;\n }\n filtered = handleArray(localSchema, source, Array.isArray(filtered) ? filtered : []);\n } else if (filtered === undefined) {\n filtered = source;\n }\n\n return handleDependencies(localSchema, source, handleConditions(localSchema, source, filtered));\n }\n\n return omit(schema, formData) as T | undefined;\n}\n", "import get from 'lodash/get';\nimport has from 'lodash/has';\n\nimport { CONST_KEY, DEFAULT_KEY, PROPERTIES_KEY, REF_KEY } from '../constants';\nimport deepEquals from '../deepEquals';\nimport type {\n Experimental_CustomMergeAllOf,\n FormContextType,\n GenericObjectType,\n RJSFSchema,\n StrictRJSFSchema,\n ValidatorType,\n} from '../types';\nimport retrieveSchema from './retrieveSchema';\n\nconst NO_VALUE = Symbol('no Value');\n\nfunction enumValuesForSchema<S extends StrictRJSFSchema = RJSFSchema>(schema: S): any[] | undefined {\n if (Array.isArray(schema.enum)) {\n return schema.enum;\n }\n\n const options = (schema.oneOf || schema.anyOf) as S[] | undefined;\n if (!Array.isArray(options)) {\n return undefined;\n }\n\n const values = options\n .map((option) => {\n if (CONST_KEY in option) {\n return option[CONST_KEY];\n }\n return Array.isArray(option.enum) && option.enum.length === 1 ? option.enum[0] : NO_VALUE;\n })\n .filter((value) => value !== NO_VALUE);\n\n return values.length > 0 ? values : undefined;\n}\n\nfunction replacementForInvalidEnumValue<S extends StrictRJSFSchema = RJSFSchema>(schema: S, formValue: any) {\n const enumValues = enumValuesForSchema(schema);\n if (!enumValues || enumValues.some((value) => deepEquals(value, formValue))) {\n return NO_VALUE;\n }\n\n const defaultValue = get(schema, DEFAULT_KEY, NO_VALUE);\n if (defaultValue !== NO_VALUE && enumValues.some((value) => deepEquals(value, defaultValue))) {\n return defaultValue;\n }\n\n return enumValues.length === 1 ? enumValues[0] : undefined;\n}\n\n/** Sanitize the `data` associated with the `oldSchema` so it is considered appropriate for the `newSchema`. If the new\n * schema does not contain any properties, then `undefined` is returned to clear all the form data. Due to the nature\n * of schemas, this sanitization happens recursively for nested objects of data. Also, any properties in the old schema\n * that are non-existent in the new schema are set to `undefined`. The data sanitization process has the following flow:\n *\n * - If the new schema is an object that contains a `properties` object then:\n * - Create a `removeOldSchemaData` object, setting each key in the `oldSchema.properties` having `data` to undefined\n * - Create an empty `nestedData` object for use in the key filtering below:\n * - Iterate over each key in the `newSchema.properties` as follows:\n * - Get the `formValue` of the key from the `data`\n * - Get the `oldKeySchema` and `newKeyedSchema` for the key, defaulting to `{}` when it doesn't exist\n * - Retrieve the schema for any refs within each `oldKeySchema` and/or `newKeySchema`\n * - Get the types of the old and new keyed schemas and if the old doesn't exist or the old & new are the same then:\n * - If `removeOldSchemaData` has an entry for the key, delete it since the new schema has the same property\n * - If type of the key in the new schema is `object`:\n * - Store the value from the recursive `sanitizeDataForNewSchema` call in `nestedData[key]`\n * - Otherwise, check for default or const values:\n * - Get the old and new `default` values from the schema and check:\n * - If the new `default` value does not match the form value:\n * - If the old `default` value DOES match the form value, then:\n * - Replace `removeOldSchemaData[key]` with the new `default`\n * - Otherwise, if the new schema is `readOnly` then replace `removeOldSchemaData[key]` with undefined\n * - Get the old and new `const` values from the schema and check:\n * - If the new `const` value does not match the form value:\n * - If the old `const` value DOES match the form value, then:\n * - Replace `removeOldSchemaData[key]` with the new `const`\n * - Otherwise, replace `removeOldSchemaData[key]` with undefined\n * - Once all keys have been processed, return an object built as follows:\n * - `{ ...removeOldSchemaData, ...nestedData, ...pick(data, keysToKeep) }`\n * - If the new and old schema types are array and the `data` is an array then:\n * - If the type of the old and new schema `items` are a non-array objects:\n * - Retrieve the schema for any refs within each `oldKeySchema.items` and/or `newKeySchema.items`\n * - If the `type`s of both items are the same (or the old does not have a type):\n * - If the type is \"object\", then:\n * - For each element in the `data` recursively sanitize the data, stopping at `maxItems` if specified\n * - Otherwise, just return the `data` removing any values after `maxItems` if it is set\n * - If the type of the old and new schema `items` are booleans of the same value, return `data` as is\n * - Otherwise return `undefined`\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be used when necessary\n * @param rootSchema - The root JSON schema of the entire form\n * @param [newSchema] - The new schema for which the data is being sanitized\n * @param [oldSchema] - The old schema from which the data originated\n * @param [data={}] - The form data associated with the schema, defaulting to an empty object when undefined\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - The new form data, with all the fields uniquely associated with the old schema set\n * to `undefined`. Will return `undefined` if the new schema is not an object containing properties.\n */\nexport default function sanitizeDataForNewSchema<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n validator: ValidatorType<T, S, F>,\n rootSchema: S,\n newSchema?: S,\n oldSchema?: S,\n data: any = {},\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): T {\n // By default, we will clear the form data\n let newFormData;\n // If the new schema is of type object and that object contains a list of properties\n if (has(newSchema, PROPERTIES_KEY)) {\n // Create an object containing root-level keys in the old schema, setting each key to undefined to remove the data\n const removeOldSchemaData: GenericObjectType = {};\n if (has(oldSchema, PROPERTIES_KEY)) {\n const properties = get(oldSchema, PROPERTIES_KEY, {});\n Object.keys(properties).forEach((key) => {\n if (has(data, key)) {\n removeOldSchemaData[key] = undefined;\n }\n });\n }\n const keys: string[] = Object.keys(get(newSchema, PROPERTIES_KEY, {}));\n // Create a place to store nested data that will be a side-effect of the filter\n const nestedData: GenericObjectType = {};\n keys.forEach((key) => {\n const formValue = get(data, key);\n let oldKeyedSchema: S = get(oldSchema, [PROPERTIES_KEY, key], {}) as S;\n let newKeyedSchema: S = get(newSchema, [PROPERTIES_KEY, key], {}) as S;\n // Resolve the refs if they exist\n if (has(oldKeyedSchema, REF_KEY)) {\n oldKeyedSchema = retrieveSchema<T, S, F>(\n validator,\n oldKeyedSchema,\n rootSchema,\n formValue,\n experimental_customMergeAllOf,\n );\n }\n if (has(newKeyedSchema, REF_KEY)) {\n newKeyedSchema = retrieveSchema<T, S, F>(\n validator,\n newKeyedSchema,\n rootSchema,\n formValue,\n experimental_customMergeAllOf,\n );\n }\n // Now get types and see if they are the same\n const oldSchemaTypeForKey = get(oldKeyedSchema, 'type');\n const newSchemaTypeForKey = get(newKeyedSchema, 'type');\n // Check if the old option has the same key with the same type\n if (!oldSchemaTypeForKey || oldSchemaTypeForKey === newSchemaTypeForKey) {\n if (has(removeOldSchemaData, key)) {\n // SIDE-EFFECT: remove the undefined value for a key that has the same type between the old and new schemas\n delete removeOldSchemaData[key];\n }\n // If it is an object, we'll recurse and store the resulting sanitized data for the key\n if (newSchemaTypeForKey === 'object' || (newSchemaTypeForKey === 'array' && Array.isArray(formValue))) {\n // SIDE-EFFECT: process the new schema type of object recursively to save iterations\n const itemData = sanitizeDataForNewSchema<T, S, F>(\n validator,\n rootSchema,\n newKeyedSchema,\n oldKeyedSchema,\n formValue,\n experimental_customMergeAllOf,\n );\n if (itemData !== undefined || newSchemaTypeForKey === 'array') {\n // only put undefined values for the array type and not the object type\n nestedData[key] = itemData;\n }\n } else {\n // Ok, the non-object types match, let's make sure that a default or a const of a different value is replaced\n // with the new default or const. This allows the case where two schemas differ that only by the default/const\n // value to be properly selected\n const newOptionDefault = get(newKeyedSchema, DEFAULT_KEY, NO_VALUE);\n const oldOptionDefault = get(oldKeyedSchema, DEFAULT_KEY, NO_VALUE);\n if (newOptionDefault !== NO_VALUE && newOptionDefault !== formValue) {\n if (oldOptionDefault === formValue) {\n // If the old default matches the formValue, we'll update the new value to match the new default\n removeOldSchemaData[key] = newOptionDefault;\n } else if (get(newKeyedSchema, 'readOnly') === true) {\n // If the new schema has the default set to read-only, treat it like a const and remove the value\n removeOldSchemaData[key] = undefined;\n }\n }\n\n const newOptionConst = get(newKeyedSchema, CONST_KEY, NO_VALUE);\n const oldOptionConst = get(oldKeyedSchema, CONST_KEY, NO_VALUE);\n if (newOptionConst !== NO_VALUE && newOptionConst !== formValue) {\n // Since this is a const, if the old value matches, replace the value with the new const otherwise clear it\n removeOldSchemaData[key] = oldOptionConst === formValue ? newOptionConst : undefined;\n }\n\n if (has(data, key)) {\n const enumReplacement = replacementForInvalidEnumValue(newKeyedSchema, formValue);\n if (enumReplacement !== NO_VALUE) {\n removeOldSchemaData[key] = enumReplacement;\n }\n }\n }\n }\n });\n\n newFormData = {\n ...(typeof data === 'string' || Array.isArray(data) ? undefined : data),\n ...removeOldSchemaData,\n ...nestedData,\n };\n // First apply removing the old schema data, then apply the nested data, then apply the old data keys to keep\n } else if (get(oldSchema, 'type') === 'array' && get(newSchema, 'type') === 'array' && Array.isArray(data)) {\n let oldSchemaItems = get(oldSchema, 'items');\n let newSchemaItems = get(newSchema, 'items');\n // If any of the array types `items` are arrays (remember arrays are objects) then we'll just drop the data\n // Eventually, we may want to deal with when either of the `items` are arrays since those tuple validations\n if (\n typeof oldSchemaItems === 'object' &&\n typeof newSchemaItems === 'object' &&\n !Array.isArray(oldSchemaItems) &&\n !Array.isArray(newSchemaItems)\n ) {\n if (has(oldSchemaItems, REF_KEY)) {\n oldSchemaItems = retrieveSchema<T, S, F>(\n validator,\n oldSchemaItems as S,\n rootSchema,\n data as T,\n experimental_customMergeAllOf,\n );\n }\n if (has(newSchemaItems, REF_KEY)) {\n newSchemaItems = retrieveSchema<T, S, F>(\n validator,\n newSchemaItems as S,\n rootSchema,\n data as T,\n experimental_customMergeAllOf,\n );\n }\n // Now get types and see if they are the same\n const oldSchemaType = get(oldSchemaItems, 'type');\n const newSchemaType = get(newSchemaItems, 'type');\n // Check if the old option has the same key with the same type\n if (!oldSchemaType || oldSchemaType === newSchemaType) {\n const maxItems = get(newSchema, 'maxItems', -1);\n if (newSchemaType === 'object') {\n newFormData = data.reduce((newValue, aValue) => {\n const itemValue = sanitizeDataForNewSchema<T, S, F>(\n validator,\n rootSchema,\n newSchemaItems as S,\n oldSchemaItems as S,\n aValue,\n experimental_customMergeAllOf,\n );\n if (itemValue !== undefined && (maxItems < 0 || newValue.length < maxItems)) {\n newValue.push(itemValue);\n }\n return newValue;\n }, []);\n } else {\n // Filter out items that are no longer valid in the new items schema (e.g., enum values that changed)\n const newItemEnumValues = enumValuesForSchema(newSchemaItems as S);\n const filteredData = newItemEnumValues\n ? data.filter((item: any) => newItemEnumValues.some((v: any) => deepEquals(v, item)))\n : data;\n newFormData = maxItems > 0 && filteredData.length > maxItems ? filteredData.slice(0, maxItems) : filteredData;\n }\n }\n } else if (\n typeof oldSchemaItems === 'boolean' &&\n typeof newSchemaItems === 'boolean' &&\n oldSchemaItems === newSchemaItems\n ) {\n // If they are both booleans and have the same value just return the data as is otherwise fall-thru to undefined\n newFormData = data;\n }\n // Also probably want to deal with `prefixItems` as tuples with the latest 2020 draft\n }\n return newFormData as T;\n}\n", "// oxlint-disable typescript/no-deprecated\nimport get from 'lodash/get';\nimport isObject from 'lodash/isObject';\nimport set from 'lodash/set';\n\nimport {\n ADDITIONAL_PROPERTIES_KEY,\n ALL_OF_KEY,\n ANY_OF_KEY,\n DEPENDENCIES_KEY,\n IF_KEY,\n ITEMS_KEY,\n NAME_KEY,\n ONE_OF_KEY,\n PROPERTIES_KEY,\n REF_KEY,\n RJSF_ADDITIONAL_PROPERTIES_FLAG,\n} from '../constants';\nimport deepEquals from '../deepEquals';\nimport getDiscriminatorFieldFromSchema from '../getDiscriminatorFieldFromSchema';\nimport type {\n Experimental_CustomMergeAllOf,\n FormContextType,\n GenericObjectType,\n PathSchema,\n RJSFSchema,\n StrictRJSFSchema,\n ValidatorType,\n} from '../types';\nimport getClosestMatchingOption from './getClosestMatchingOption';\nimport retrieveSchema from './retrieveSchema';\n\n/** An internal helper that generates an `PathSchema` object for the `schema`, recursively with protection against\n * infinite recursion\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be used when necessary\n * @param schema - The schema for which the `PathSchema` is desired\n * @param [name=''] - The base name for the schema\n * @param [rootSchema] - The root schema, used to primarily to look up `$ref`s\n * @param [formData] - The current formData, if any, to assist retrieving a schema\n * @param [_recurseList=[]] - The list of retrieved schemas currently being recursed, used to prevent infinite recursion\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - The `PathSchema` object for the `schema`\n */\nfunction toPathSchemaInternal<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n validator: ValidatorType<T, S, F>,\n schema: S,\n name: string,\n rootSchema?: S,\n formData?: T,\n _recurseList: S[] = [],\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): PathSchema<T> {\n if (REF_KEY in schema || DEPENDENCIES_KEY in schema || ALL_OF_KEY in schema || IF_KEY in schema) {\n const innerSchema = retrieveSchema<T, S, F>(validator, schema, rootSchema, formData, experimental_customMergeAllOf);\n const sameSchemaIndex = _recurseList.findIndex((item) => deepEquals(item, innerSchema));\n if (sameSchemaIndex === -1) {\n return toPathSchemaInternal<T, S, F>(\n validator,\n innerSchema,\n name,\n rootSchema,\n formData,\n _recurseList.concat(innerSchema),\n experimental_customMergeAllOf,\n );\n }\n }\n\n let pathSchema: PathSchema<T> = {\n [NAME_KEY]: name.replace(/^\\./, ''),\n } as PathSchema<T>;\n\n if (ONE_OF_KEY in schema || ANY_OF_KEY in schema) {\n const xxxOf: S[] = ONE_OF_KEY in schema ? (schema.oneOf as S[]) : (schema.anyOf as S[]);\n const discriminator = getDiscriminatorFieldFromSchema<S>(schema);\n const index = getClosestMatchingOption<T, S, F>(\n validator,\n rootSchema!,\n formData,\n xxxOf,\n 0,\n discriminator,\n experimental_customMergeAllOf,\n );\n const innerSchema: S = xxxOf[index];\n pathSchema = {\n ...pathSchema,\n ...toPathSchemaInternal<T, S, F>(\n validator,\n innerSchema,\n name,\n rootSchema,\n formData,\n _recurseList,\n experimental_customMergeAllOf,\n ),\n };\n }\n\n if (ADDITIONAL_PROPERTIES_KEY in schema && schema[ADDITIONAL_PROPERTIES_KEY] !== false) {\n set(pathSchema, RJSF_ADDITIONAL_PROPERTIES_FLAG, true);\n const additionalSchema = (\n isObject(schema[ADDITIONAL_PROPERTIES_KEY]) ? schema[ADDITIONAL_PROPERTIES_KEY] : {}\n ) as S;\n const definedProperties = get(schema, PROPERTIES_KEY, {});\n for (const key of Object.keys((formData ?? {}) as GenericObjectType)) {\n if (!(key in definedProperties)) {\n (pathSchema as PathSchema<GenericObjectType>)[key] = toPathSchemaInternal<T, S, F>(\n validator,\n additionalSchema,\n `${name}.${key}`,\n rootSchema,\n get(formData, [key]),\n _recurseList,\n experimental_customMergeAllOf,\n );\n }\n }\n }\n\n if (ITEMS_KEY in schema && Array.isArray(formData)) {\n const { items: schemaItems, additionalItems: schemaAdditionalItems } = schema;\n\n if (Array.isArray(schemaItems)) {\n formData.forEach((element, i: number) => {\n if (schemaItems[i]) {\n (pathSchema as PathSchema<T[]>)[i] = toPathSchemaInternal<T, S, F>(\n validator,\n schemaItems[i] as S,\n `${name}.${i}`,\n rootSchema,\n element,\n _recurseList,\n experimental_customMergeAllOf,\n );\n } else if (schemaAdditionalItems) {\n (pathSchema as PathSchema<T[]>)[i] = toPathSchemaInternal<T, S, F>(\n validator,\n schemaAdditionalItems as S,\n `${name}.${i}`,\n rootSchema,\n element,\n _recurseList,\n experimental_customMergeAllOf,\n );\n } else {\n // oxlint-disable-next-line no-console\n console.warn(`Unable to generate path schema for \"${name}.${i}\". No schema defined for it`);\n }\n });\n } else {\n formData.forEach((element, i: number) => {\n (pathSchema as PathSchema<T[]>)[i] = toPathSchemaInternal<T, S, F>(\n validator,\n schemaItems as S,\n `${name}.${i}`,\n rootSchema,\n element,\n _recurseList,\n experimental_customMergeAllOf,\n );\n });\n }\n } else if (PROPERTIES_KEY in schema) {\n // This is a deprecated function that is no longer used by RJSF\n // oxlint-disable-next-line guard-for-in\n for (const property in schema.properties) {\n const field: S = get(schema, [PROPERTIES_KEY, property], {}) as S;\n (pathSchema as PathSchema<GenericObjectType>)[property] = toPathSchemaInternal<T, S, F>(\n validator,\n field,\n `${name}.${property}`,\n rootSchema,\n // It's possible that formData is not an object -- this can happen if an\n // array item has just been added, but not populated with data yet\n get(formData, [property]),\n _recurseList,\n experimental_customMergeAllOf,\n );\n }\n }\n return pathSchema;\n}\n\n/** Generates an `PathSchema` object for the `schema`, recursively\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be used when necessary\n * @param schema - The schema for which the `PathSchema` is desired\n * @param [name=''] - The base name for the schema\n * @param [rootSchema] - The root schema, used to primarily to look up `$ref`s\n * @param [formData] - The current formData, if any, to assist retrieving a schema\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - The `PathSchema` object for the `schema`\n * @deprecated - To be removed as an exported `@rjsf/utils` function in a future release\n */\nexport default function toPathSchema<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n validator: ValidatorType<T, S, F>,\n schema: S,\n name = '',\n rootSchema?: S,\n formData?: T,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): PathSchema<T> {\n return toPathSchemaInternal(validator, schema, name, rootSchema, formData, undefined, experimental_customMergeAllOf);\n}\n", "import get from 'lodash/get';\n\nimport { ID_KEY, JSON_SCHEMA_DRAFT_2020_12, SCHEMA_KEY } from './constants';\nimport deepEquals from './deepEquals';\nimport { makeAllReferencesAbsolute } from './findSchemaDefinition';\nimport {\n findFieldInSchema,\n findSelectedOptionInXxxOf,\n getDefaultFormState,\n getDisplayLabel,\n getClosestMatchingOption,\n getFirstMatchingOption,\n getFromSchema,\n isFilesArray,\n isMultiSelect,\n isSelect,\n omitExtraData,\n retrieveSchema,\n sanitizeDataForNewSchema,\n toPathSchema,\n} from './schema';\nimport type {\n Experimental_CustomMergeAllOf,\n Experimental_DefaultFormStateBehavior,\n FormContextType,\n FoundFieldType,\n GlobalUISchemaOptions,\n PathSchema,\n RJSFSchema,\n SchemaFieldPath,\n SchemaUtilsType,\n StrictRJSFSchema,\n UiSchema,\n ValidatorType,\n} from './types';\n\n/** The `SchemaUtils` class provides a wrapper around the publicly exported APIs in the `utils/schema` directory such\n * that one does not have to explicitly pass the `validator`, `rootSchema`, `experimental_defaultFormStateBehavior` or\n * `experimental_customMergeAllOf` to each method. Since these generally do not change across a `Form`, this allows for\n * providing a simplified set of APIs to the `@rjsf/core` components and the various themes as well. This class\n * implements the `SchemaUtilsType` interface.\n */\nclass SchemaUtils<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n> implements SchemaUtilsType<T, S, F> {\n rootSchema: S;\n validator: ValidatorType<T, S, F>;\n experimental_defaultFormStateBehavior: Experimental_DefaultFormStateBehavior;\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>;\n\n /** Constructs the `SchemaUtils` instance with the given `validator` and `rootSchema` stored as instance variables\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs\n * @param rootSchema - The root schema that will be forwarded to all the APIs\n * @param experimental_defaultFormStateBehavior - Configuration flags to allow users to override default form state behavior\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n */\n constructor(\n validator: ValidatorType<T, S, F>,\n rootSchema: S,\n experimental_defaultFormStateBehavior: Experimental_DefaultFormStateBehavior,\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n ) {\n if (rootSchema?.[SCHEMA_KEY] === JSON_SCHEMA_DRAFT_2020_12) {\n this.rootSchema = makeAllReferencesAbsolute(rootSchema, get(rootSchema, ID_KEY, '#'));\n } else {\n this.rootSchema = rootSchema;\n }\n this.validator = validator;\n this.experimental_defaultFormStateBehavior = experimental_defaultFormStateBehavior;\n this.experimental_customMergeAllOf = experimental_customMergeAllOf;\n }\n\n /** Returns the `rootSchema` in the `SchemaUtilsType`\n *\n * @returns - The `rootSchema`\n */\n getRootSchema() {\n return this.rootSchema;\n }\n\n /** Returns the `ValidatorType` in the `SchemaUtilsType`\n *\n * @returns - The `ValidatorType`\n */\n getValidator() {\n return this.validator;\n }\n\n /** Determines whether either the `validator` and `rootSchema` differ from the ones associated with this instance of\n * the `SchemaUtilsType`. If either `validator` or `rootSchema` are falsy, then return false to prevent the creation\n * of a new `SchemaUtilsType` with incomplete properties.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be compared against the current one\n * @param rootSchema - The root schema that will be compared against the current one\n * @param [experimental_defaultFormStateBehavior] Optional configuration object, if provided, allows users to override default form state behavior\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - True if the `SchemaUtilsType` differs from the given `validator` or `rootSchema`\n */\n doesSchemaUtilsDiffer(\n validator: ValidatorType<T, S, F>,\n rootSchema: S,\n experimental_defaultFormStateBehavior = {},\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n ): boolean {\n // If either validator or rootSchema are falsy, return false to prevent the creation\n // of a new SchemaUtilsType with incomplete properties.\n if (!validator || !rootSchema) {\n return false;\n }\n\n return (\n this.validator !== validator ||\n !deepEquals(this.rootSchema, rootSchema) ||\n !deepEquals(this.experimental_defaultFormStateBehavior, experimental_defaultFormStateBehavior) ||\n this.experimental_customMergeAllOf !== experimental_customMergeAllOf\n );\n }\n\n /** Finds the field specified by the `path` within the root or recursed `schema`. If there is no field for the specified\n * `path`, then the default `{ field: undefined, isRequired: undefined }` is returned. It determines whether a leaf\n * field is in the `required` list for its parent and if so, it is marked as required on return.\n *\n * @param schema - The current node within the JSON schema\n * @param path - The remaining keys in the path to the desired field\n * @param [formData] - The form data that is used to determine which oneOf option\n * @returns - An object that contains the field and its required state. If no field can be found then\n * `{ field: undefined, isRequired: undefined }` is returned.\n */\n findFieldInSchema(schema: S, path: SchemaFieldPath, formData?: T): FoundFieldType<S> {\n return findFieldInSchema(\n this.validator,\n this.rootSchema,\n schema,\n path,\n formData,\n this.experimental_customMergeAllOf,\n );\n }\n\n /** Finds the oneOf option inside the `schema['any/oneOf']` list which has the `properties[selectorField].default` that\n * matches the `formData[selectorField]` value. For the purposes of this function, `selectorField` is either\n * `schema.discriminator.propertyName` or `fallbackField`.\n *\n * @param schema - The schema element in which to search for the selected oneOf option\n * @param fallbackField - The field to use as a backup selector field if the schema does not have a required field\n * @param xxx - Either `oneOf` or `anyOf`, defines which value is being sought\n * @param [formData={}] - The form data that is used to determine which oneOf option\n * @returns - The anyOf/oneOf option that matches the selector field in the schema or undefined if nothing is selected\n */\n findSelectedOptionInXxxOf(schema: S, fallbackField: string, xxx: 'anyOf' | `oneOf`, formData: T): S | undefined {\n return findSelectedOptionInXxxOf(\n this.validator,\n this.rootSchema,\n schema,\n fallbackField,\n xxx,\n formData,\n this.experimental_customMergeAllOf,\n );\n }\n\n /** Returns the superset of `formData` that includes the given set updated to include any missing fields that have\n * computed to have defaults provided in the `schema`.\n *\n * @param schema - The schema for which the default state is desired\n * @param [formData] - The current formData, if any, onto which to provide any missing defaults\n * @param [includeUndefinedValues=false] - Optional flag, if true, cause undefined values to be added as defaults.\n * If \"excludeObjectChildren\", pass `includeUndefinedValues` as false when computing defaults for any nested\n * object properties.\n * @param initialDefaultsGenerated - Indicates whether or not initial defaults have been generated\n * @returns - The resulting `formData` with all the defaults provided\n */\n getDefaultFormState(\n schema: S,\n formData?: T,\n includeUndefinedValues: boolean | 'excludeObjectChildren' = false,\n initialDefaultsGenerated?: boolean,\n ): T | T[] | undefined {\n return getDefaultFormState<T, S, F>(\n this.validator,\n schema,\n formData,\n this.rootSchema,\n includeUndefinedValues,\n this.experimental_defaultFormStateBehavior,\n this.experimental_customMergeAllOf,\n initialDefaultsGenerated,\n );\n }\n\n /** Determines whether the combination of `schema` and `uiSchema` properties indicates that the label for the `schema`\n * should be displayed in a UI.\n *\n * @param schema - The schema for which the display label flag is desired\n * @param [uiSchema] - The UI schema from which to derive potentially displayable information\n * @param [globalOptions={}] - The optional Global UI Schema from which to get any fallback `xxx` options\n * @returns - True if the label should be displayed or false if it should not\n */\n getDisplayLabel(schema: S, uiSchema?: UiSchema<T, S, F>, globalOptions?: GlobalUISchemaOptions) {\n return getDisplayLabel<T, S, F>(\n this.validator,\n schema,\n uiSchema,\n this.rootSchema,\n globalOptions,\n this.experimental_customMergeAllOf,\n );\n }\n\n /** Determines which of the given `options` provided most closely matches the `formData`.\n * Returns the index of the option that is valid and is the closest match, or 0 if there is no match.\n *\n * The closest match is determined using the number of matching properties, and more heavily favors options with\n * matching readOnly, default, or const values.\n *\n * @param formData - The form data associated with the schema\n * @param options - The list of options that can be selected from\n * @param [selectedOption] - The index of the currently selected option, defaulted to -1 if not specified\n * @param [discriminatorField] - The optional name of the field within the options object whose value is used to\n * determine which option is selected\n * @returns - The index of the option that is the closest match to the `formData` or the `selectedOption` if no match\n */\n getClosestMatchingOption(\n formData: T | undefined,\n options: S[],\n selectedOption?: number,\n discriminatorField?: string,\n ): number {\n return getClosestMatchingOption<T, S, F>(\n this.validator,\n this.rootSchema,\n formData,\n options,\n selectedOption,\n discriminatorField,\n this.experimental_customMergeAllOf,\n );\n }\n\n /** Given the `formData` and list of `options`, attempts to find the index of the first option that matches the data.\n * Always returns the first option if there is nothing that matches.\n *\n * @param formData - The current formData, if any, used to figure out a match\n * @param options - The list of options to find a matching options from\n * @param [discriminatorField] - The optional name of the field within the options object whose value is used to\n * determine which option is selected\n * @returns - The firstindex of the matched option or 0 if none is available\n */\n getFirstMatchingOption(formData: T | undefined, options: S[], discriminatorField?: string): number {\n return getFirstMatchingOption<T, S, F>(this.validator, formData, options, this.rootSchema, discriminatorField);\n }\n\n /** Helper that acts like lodash's `get` but additionally retrieves `$ref`s as needed to get the path for schemas\n * containing potentially nested `$ref`s.\n *\n * @param schema - The current node within the JSON schema recursion\n * @param path - The remaining keys in the path to the desired property\n * @param defaultValue - The value to return if a value is not found for the `pathList` path\n * @returns - The internal schema from the `schema` for the given `path` or the `defaultValue` if not found\n */\n getFromSchema(schema: S, path: SchemaFieldPath, defaultValue: T): T;\n getFromSchema(schema: S, path: SchemaFieldPath, defaultValue: S): S;\n getFromSchema(schema: S, path: SchemaFieldPath, defaultValue: T | S): T | S {\n return getFromSchema<T, S, F>(\n this.validator,\n this.rootSchema,\n schema,\n path,\n // @ts-expect-error TS2769: No overload matches this call\n defaultValue,\n this.experimental_customMergeAllOf,\n );\n }\n\n /** Checks to see if the `schema` and `uiSchema` combination represents an array of files\n *\n * @param schema - The schema for which check for array of files flag is desired\n * @param [uiSchema] - The UI schema from which to check the widget\n * @returns - True if schema/uiSchema contains an array of files, otherwise false\n */\n isFilesArray(schema: S, uiSchema?: UiSchema<T, S, F>) {\n return isFilesArray<T, S, F>(this.validator, schema, uiSchema, this.rootSchema, this.experimental_customMergeAllOf);\n }\n\n /** Checks to see if the `schema` combination represents a multi-select\n *\n * @param schema - The schema for which check for a multi-select flag is desired\n * @returns - True if schema contains a multi-select, otherwise false\n */\n isMultiSelect(schema: S) {\n return isMultiSelect<T, S, F>(this.validator, schema, this.rootSchema, this.experimental_customMergeAllOf);\n }\n\n /** Checks to see if the `schema` combination represents a select\n *\n * @param schema - The schema for which check for a select flag is desired\n * @returns - True if schema contains a select, otherwise false\n */\n isSelect(schema: S) {\n return isSelect<T, S, F>(this.validator, schema, this.rootSchema, this.experimental_customMergeAllOf);\n }\n /**\n * The function takes a `schema` and `formData` and returns a copy of the formData with any fields not defined in the schema removed.\n * This is useful for ensuring that only data that is relevant to the schema is preserved. Objects with `additionalProperties`\n * keyword set to `true` will not have their extra fields removed.\n *\n * @param schema - The schema to use for filtering the `formData`\n * @param [formData] - The formData to filter\n * @returns The new form data, with any fields not defined in the schema removed\n */\n omitExtraData(schema: S, formData?: T): T | undefined {\n return omitExtraData<T, S, F>(this.validator, schema, this.rootSchema, formData);\n }\n\n /** Retrieves an expanded schema that has had all of its conditions, additional properties, references and\n * dependencies resolved and merged into the `schema` given a `rawFormData` that is used to do the potentially\n * recursive resolution.\n *\n * @param schema - The schema for which retrieving a schema is desired\n * @param [rawFormData] - The current formData, if any, to assist retrieving a schema\n * @param [resolveAnyOfOrOneOfRefs] - Optional flag indicating whether to resolved refs in anyOf/oneOf lists\n * @returns - The schema having its conditions, additional properties, references and dependencies resolved\n */\n retrieveSchema(schema: S, rawFormData?: T, resolveAnyOfOrOneOfRefs?: boolean) {\n return retrieveSchema<T, S, F>(\n this.validator,\n schema,\n this.rootSchema,\n rawFormData,\n this.experimental_customMergeAllOf,\n resolveAnyOfOrOneOfRefs,\n );\n }\n\n /** Sanitize the `data` associated with the `oldSchema` so it is considered appropriate for the `newSchema`. If the\n * new schema does not contain any properties, then `undefined` is returned to clear all the form data. Due to the\n * nature of schemas, this sanitization happens recursively for nested objects of data. Also, any properties in the\n * old schemas that are non-existent in the new schema are set to `undefined`.\n *\n * @param [newSchema] - The new schema for which the data is being sanitized\n * @param [oldSchema] - The old schema from which the data originated\n * @param [data={}] - The form data associated with the schema, defaulting to an empty object when undefined\n * @returns - The new form data, with all the fields uniquely associated with the old schema set\n * to `undefined`. Will return `undefined` if the new schema is not an object containing properties.\n */\n sanitizeDataForNewSchema(newSchema?: S, oldSchema?: S, data?: any): T {\n return sanitizeDataForNewSchema(\n this.validator,\n this.rootSchema,\n newSchema,\n oldSchema,\n data,\n this.experimental_customMergeAllOf,\n );\n }\n\n /** Generates an `PathSchema` object for the `schema`, recursively\n *\n * @param schema - The schema for which the display label flag is desired\n * @param [name] - The base name for the schema\n * @param [formData] - The current formData, if any, onto which to provide any missing defaults\n * @returns - The `PathSchema` object for the `schema`\n */\n // oxlint-disable-next-line typescript/no-deprecated\n toPathSchema(schema: S, name?: string, formData?: T): PathSchema<T> {\n // oxlint-disable-next-line typescript/no-deprecated\n return toPathSchema<T, S, F>(\n this.validator,\n schema,\n name,\n this.rootSchema,\n formData,\n this.experimental_customMergeAllOf,\n );\n }\n}\n\n/** Creates a `SchemaUtilsType` interface that is based around the given `validator` and `rootSchema` parameters. The\n * resulting interface implementation will forward the `validator` and `rootSchema` to all the wrapped APIs.\n *\n * @param validator - an implementation of the `ValidatorType` interface that will be forwarded to all the APIs\n * @param rootSchema - The root schema that will be forwarded to all the APIs\n * @param [experimental_defaultFormStateBehavior] Optional configuration object, if provided, allows users to override default form state behavior\n * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas\n * @returns - An implementation of a `SchemaUtilsType` interface\n */\nexport default function createSchemaUtils<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n validator: ValidatorType<T, S, F>,\n rootSchema: S,\n experimental_defaultFormStateBehavior = {},\n experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,\n): SchemaUtilsType<T, S, F> {\n return new SchemaUtils<T, S, F>(\n validator,\n rootSchema,\n experimental_defaultFormStateBehavior,\n experimental_customMergeAllOf,\n );\n}\n", "/** Given the `FileReader.readAsDataURL()` based `dataURI` extracts that data into an actual Blob along with the name\n * of that Blob if provided in the URL. If no name is provided, then the name falls back to `unknown`.\n *\n * @param dataURI - The `DataUrl` potentially containing name and raw data to be converted to a Blob\n * @returns - an object containing a Blob and its name, extracted from the URI\n */\nexport default function dataURItoBlob(dataURILike: string) {\n // check if is dataURI\n if (!dataURILike.includes('data:')) {\n throw new Error('File is invalid: URI must be a dataURI');\n }\n const dataURI = dataURILike.slice(5);\n // split the dataURI into media and base64, with the base64 signature\n const splitted = dataURI.split(';base64,');\n // if the base64 signature is not present, the latter part will become empty\n if (splitted.length !== 2) {\n throw new Error('File is invalid: dataURI must be base64');\n }\n // extract the mime type, media parameters including the name, and the base64 string\n const [media, base64] = splitted;\n const [mime, ...mediaparams] = media.split(';');\n const type = mime || '';\n\n // extract the name from the parameters\n const name = decodeURI(\n // parse the parameters into key-value pairs, find a key, and extract a value\n // if no key is found, then the name is unknown\n mediaparams.map((param) => param.split('=')).find(([key]) => key === 'name')?.[1] || 'unknown',\n );\n\n // Built the Uint8Array Blob parameter from the base64 string.\n try {\n const binary = atob(base64);\n const array = new Array(binary.length);\n for (let i = 0; i < binary.length; i += 1) {\n array[i] = binary.charCodeAt(i);\n }\n // Create the blob object\n const blob = new window.Blob([new Uint8Array(array)], { type });\n\n return { blob, name };\n } catch (error) {\n throw new Error(`File is invalid: ${(error as Error).message}`);\n }\n}\n", "/** Returns a string representation of the `num` that is padded with leading \"0\"s if necessary\n *\n * @param num - The number to pad\n * @param width - The width of the string at which no lead padding is necessary\n * @returns - The number converted to a string with leading zero padding if the number of digits is less than `width`\n */\nexport default function pad(num: number, width: number) {\n let s = String(num);\n while (s.length < width) {\n s = `0${s}`;\n }\n return s;\n}\n", "import pad from './pad';\nimport type { EnumOptionsType, RJSFSchema, StrictRJSFSchema } from './types';\n\n/** Returns a list of options for a date range between `start` and `stop`. If the start date is greater than the end\n * date, then the date range is reversed. If `start` and `stop` are negative numbers (or zero), then they will be\n * treated as relative to the current year.\n *\n * @param start - The starting point of the date range\n * @param stop - The ending point of the date range\n * @returns - The list of EnumOptionsType for the date range between `start` and `stop`\n * @throws - Error when `start` and `stop` aren't both <= 0 or > 0\n */\nexport default function dateRangeOptions<S extends StrictRJSFSchema = RJSFSchema>(\n start: number,\n stop: number,\n): EnumOptionsType<S>[] {\n const bothRelative = start <= 0 && stop <= 0;\n const eitherNegative = start < 0 || stop < 0;\n if (!bothRelative && eitherNegative) {\n throw new Error(`Both start (${start}) and stop (${stop}) must both be <= 0 or > 0, got one of each`);\n }\n const currentYear = new Date().getFullYear();\n const resolvedStart = bothRelative ? currentYear + start : start;\n const resolvedStop = bothRelative ? currentYear + stop : stop;\n if (resolvedStart > resolvedStop) {\n return dateRangeOptions<S>(stop, start).reverse();\n }\n const options: EnumOptionsType<S>[] = [];\n for (let i = resolvedStart; i <= resolvedStop; i += 1) {\n options.push({ value: i, label: pad(i, 2) });\n }\n return options;\n}\n", "/** Potentially substitutes all replaceable parameters with the associated value(s) from the `params` if available. When\n * a `params` array is provided, each value in the array is used to replace any of the replaceable parameters in the\n * `inputString` using the `%1`, `%2`, etc. replacement specifiers.\n *\n * @param inputString - The string which will be potentially updated with replacement parameters\n * @param params - The optional list of replaceable parameter values to substitute into the english string\n * @returns - The updated string with any replacement specifiers replaced\n */\nexport default function replaceStringParameters(inputString: string, params?: string[]) {\n let output = inputString;\n if (Array.isArray(params)) {\n const parts = output.split(/(%\\d)/);\n params.forEach((param, index) => {\n const partIndex = parts.findIndex((part) => part === `%${index + 1}`);\n if (partIndex >= 0) {\n parts[partIndex] = param;\n }\n });\n output = parts.join('');\n }\n return output;\n}\n", "import type { TranslatableString } from './enums';\nimport replaceStringParameters from './replaceStringParameters';\n\n/** Translates a `TranslatableString` value `stringToTranslate` into english. When a `params` array is provided, each\n * value in the array is used to replace any of the replaceable parameters in the `stringToTranslate` using the `%1`,\n * `%2`, etc. replacement specifiers.\n *\n * @param stringToTranslate - The `TranslatableString` value to convert to english\n * @param params - The optional list of replaceable parameter values to substitute into the english string\n * @returns - The `stringToTranslate` itself with any replaceable parameter values substituted\n */\nexport default function englishStringTranslator(stringToTranslate: TranslatableString, params?: string[]): string {\n return replaceStringParameters(stringToTranslate, params);\n}\n", "import type { EnumOptionsType, RJSFSchema, StrictRJSFSchema } from './types';\n\n/** Returns the value(s) from `allEnumOptions` at the index(es) provided by `valueIndex`. If `valueIndex` is not an\n * array AND the index is not valid for `allEnumOptions`, `emptyValue` is returned. If `valueIndex` is an array, AND it\n * contains an invalid index, the returned array will have the resulting undefined values filtered out, leaving only\n * valid values or in the worst case, an empty array.\n *\n * @param valueIndex - The index(es) of the value(s) that should be returned\n * @param [allEnumOptions=[]] - The list of all the known enumOptions\n * @param [emptyValue] - The value to return when the non-array `valueIndex` does not refer to a real option\n * @returns - The single or list of values specified by the single or list of indexes if they are valid. Otherwise,\n * `emptyValue` or an empty list.\n */\nexport default function enumOptionsValueForIndex<S extends StrictRJSFSchema = RJSFSchema>(\n valueIndex: string | number | (string | number)[],\n allEnumOptions: EnumOptionsType<S>[] = [],\n emptyValue?: EnumOptionsType<S>['value'],\n): EnumOptionsType<S>['value'] | EnumOptionsType<S>['value'][] | undefined {\n if (Array.isArray(valueIndex)) {\n return (\n valueIndex\n .map((index) => enumOptionsValueForIndex(index, allEnumOptions))\n // The recursive call returns undefined for a bad option, filter those out\n .filter((val) => val !== undefined)\n );\n }\n // So Number(null) and Number('') both return 0, so use emptyValue for those two values\n const index = valueIndex === '' || valueIndex === null ? -1 : Number(valueIndex);\n const option = allEnumOptions[index];\n return option ? option.value : emptyValue;\n}\n", "import deepEquals from './deepEquals';\nimport enumOptionsValueForIndex from './enumOptionsValueForIndex';\nimport type { EnumOptionsType, RJSFSchema, StrictRJSFSchema } from './types';\n\n/** Removes the enum option value at the `valueIndex` from the currently `selected` (list of) value(s). If `selected` is\n * a list, then that list is updated to remove the enum option value with the `valueIndex` in `allEnumOptions`. If it is\n * a single value, then if the enum option value with the `valueIndex` in `allEnumOptions` matches `selected`, undefined\n * is returned, otherwise the `selected` value is returned.\n *\n * @param valueIndex - The index of the value to be removed from the selected list or single value\n * @param selected - The current (list of) selected value(s)\n * @param [allEnumOptions=[]] - The list of all the known enumOptions\n * @returns - The updated `selected` with the enum option value at `valueIndex` in `allEnumOptions` removed from it,\n * unless `selected` is a single value. In that case, if the `valueIndex` value matches `selected`, returns\n * undefined, otherwise `selected`.\n */\nexport default function enumOptionsDeselectValue<S extends StrictRJSFSchema = RJSFSchema>(\n valueIndex: string | number,\n selected?: EnumOptionsType<S>['value'] | EnumOptionsType<S>['value'][],\n allEnumOptions: EnumOptionsType<S>[] = [],\n): EnumOptionsType<S>['value'] | EnumOptionsType<S>['value'][] | undefined {\n const value = enumOptionsValueForIndex<S>(valueIndex, allEnumOptions);\n if (Array.isArray(selected)) {\n return selected.filter((v) => !deepEquals(v, value));\n }\n return deepEquals(value, selected) ? undefined : selected;\n}\n", "import deepEquals from './deepEquals';\nimport type { EnumOptionsType, RJSFSchema, StrictRJSFSchema } from './types';\n\n/** Determines whether the given `value` is (one of) the `selected` value(s).\n *\n * @param value - The value being checked to see if it is selected\n * @param selected - The current selected value or list of values\n * @returns - true if the `value` is one of the `selected` ones, false otherwise\n */\nexport default function enumOptionsIsSelected<S extends StrictRJSFSchema = RJSFSchema>(\n value: EnumOptionsType<S>['value'],\n selected: EnumOptionsType<S>['value'] | EnumOptionsType<S>['value'][],\n) {\n if (Array.isArray(selected)) {\n return selected.some((sel) => deepEquals(sel, value));\n }\n return deepEquals(selected, value);\n}\n", "import enumOptionsIsSelected from './enumOptionsIsSelected';\nimport type { EnumOptionsType, RJSFSchema, StrictRJSFSchema } from './types';\n\n/** Returns the index(es) of the options in `allEnumOptions` whose value(s) match the ones in `value`. All the\n * `enumOptions` are filtered based on whether they are a \"selected\" `value` and the index of each selected one is then\n * stored in an array. If `multiple` is true, that array is returned, otherwise the first element in the array is\n * returned.\n *\n * @param value - The single value or list of values for which indexes are desired\n * @param [allEnumOptions=[]] - The list of all the known enumOptions\n * @param [multiple=false] - Optional flag, if true will return a list of index, otherwise a single one\n * @returns - A single string index for the first `value` in `allEnumOptions`, if not `multiple`. Otherwise, the list\n * of indexes for (each of) the value(s) in `value`.\n */\nexport default function enumOptionsIndexForValue<S extends StrictRJSFSchema = RJSFSchema>(\n value: EnumOptionsType<S>['value'] | EnumOptionsType<S>['value'][],\n allEnumOptions: EnumOptionsType<S>[] = [],\n multiple = false,\n): string | string[] | undefined {\n const selectedIndexes: string[] = allEnumOptions\n .map((opt, index) => (enumOptionsIsSelected(opt.value, value) ? String(index) : undefined))\n .filter((opt) => typeof opt !== 'undefined');\n if (!multiple) {\n return selectedIndexes[0];\n }\n return selectedIndexes;\n}\n", "import enumOptionsIndexForValue from './enumOptionsIndexForValue';\nimport type { EnumOptionsType, OptionValueFormat, StrictRJSFSchema, RJSFSchema } from './types';\n\n/** Computes the value to pass to a select element's `value` attribute.\n *\n * When `format` is `'realValue'`, converts form data values to strings.\n * When `format` is `'indexed'` (the default), resolves to index-based values via\n * `enumOptionsIndexForValue`. Returns `emptyValue` when the current value is empty.\n *\n * @param value - The current form data value\n * @param enumOptions - The available enum options\n * @param multiple - Whether the select allows multiple selections\n * @param [format='indexed'] - How option values are encoded on the DOM\n * @param emptyValue - The value to return when the selection is empty\n * @returns The value to use for the select element's `value` attribute\n */\nexport default function enumOptionSelectedValue<S extends StrictRJSFSchema = RJSFSchema>(\n value: any,\n enumOptions: EnumOptionsType<S>[] | undefined,\n multiple: boolean,\n format: OptionValueFormat = 'indexed',\n emptyValue?: any,\n): any {\n const isEmpty =\n typeof value === 'undefined' ||\n (multiple && Array.isArray(value) && value.length < 1) ||\n (!multiple && value === emptyValue);\n\n if (isEmpty) {\n return emptyValue;\n }\n\n if (format === 'realValue') {\n return multiple ? value.map(String) : String(value);\n }\n\n const indexes = enumOptionsIndexForValue<S>(value, enumOptions, multiple);\n return typeof indexes === 'undefined' ? emptyValue : indexes;\n}\n", "import isNil from 'lodash/isNil';\n\nimport enumOptionsValueForIndex from './enumOptionsValueForIndex';\nimport type { EnumOptionsType, RJSFSchema, StrictRJSFSchema } from './types';\n\n/** Add the enum option value at the `valueIndex` to the list of `selected` values in the proper order as defined by\n * `allEnumOptions`\n *\n * @param valueIndex - The index of the value that should be selected\n * @param selected - The current list of selected values\n * @param [allEnumOptions=[]] - The list of all the known enumOptions\n * @returns - The updated list of selected enum values with enum value at the `valueIndex` added to it\n */\nexport default function enumOptionsSelectValue<S extends StrictRJSFSchema = RJSFSchema>(\n valueIndex: string | number,\n selected: EnumOptionsType<S>['value'][],\n allEnumOptions: EnumOptionsType<S>[] = [],\n) {\n const value = enumOptionsValueForIndex<S>(valueIndex, allEnumOptions);\n if (!isNil(value)) {\n const index = allEnumOptions.findIndex((opt) => value === opt.value);\n const all = allEnumOptions.map(({ value: val }) => val);\n const updated = selected.slice(0, index).concat(value, selected.slice(index));\n // As inserting values at predefined index positions doesn't work with empty\n // arrays, we need to reorder the updated selection to match the initial order\n return updated.sort((a, b) => Number(all.indexOf(a) > all.indexOf(b)));\n }\n return selected;\n}\n", "import enumOptionsValueForIndex from './enumOptionsValueForIndex';\nimport type { EnumOptionsType, OptionValueFormat, StrictRJSFSchema, RJSFSchema } from './types';\n\n/** Resolves a single DOM value string back to its typed enum value in `'realValue'` mode.\n *\n * First attempts a reverse lookup by matching `String(opt.value)` against the input.\n * If no option matches and the input parses as a valid index, falls back to the\n * option at that index — this is how object/array enum values round-trip, since\n * they are encoded as indices by the encoder.\n *\n * @param value - A single string value from a DOM attribute\n * @param enumOptions - The available enum options\n * @param emptyValue - The value to return when the input is empty, options are missing, or no match is found\n * @returns The original typed enum value, or `emptyValue`\n */\nfunction decodeSingle<S extends StrictRJSFSchema = RJSFSchema>(\n value: string,\n enumOptions: EnumOptionsType<S>[] | undefined,\n emptyValue?: unknown,\n): unknown {\n if (value === '' || !Array.isArray(enumOptions)) {\n return emptyValue;\n }\n const match = enumOptions.find((opt) => String(opt.value) === value);\n if (match) {\n return match.value;\n }\n // Fallback: value might be an index (for object/array enum values)\n const index = Number(value);\n if (!Number.isNaN(index) && index >= 0 && index < enumOptions.length) {\n return enumOptions[index].value;\n }\n return emptyValue;\n}\n\n/** Decodes a string from a DOM value attribute back to a typed enum value.\n *\n * When `format` is `'realValue'`, does a reverse lookup: finds the enum option\n * whose `String(value)` matches the input string and returns the original typed value.\n * For object/array values that were encoded as indices, falls back to index resolution.\n *\n * When `format` is `'indexed'` (the default), uses index-based resolution via\n * `enumOptionsValueForIndex`.\n *\n * @param value - The string value(s) from the DOM\n * @param enumOptions - The available enum options\n * @param [format='indexed'] - How the values were encoded on the DOM\n * @param emptyValue - The value to return for empty/missing selections\n * @returns The original typed enum value(s)\n */\nexport default function enumOptionValueDecoder<S extends StrictRJSFSchema = RJSFSchema>(\n value: string | string[],\n enumOptions: EnumOptionsType<S>[] | undefined,\n format: OptionValueFormat = 'indexed',\n emptyValue?: unknown,\n): unknown {\n if (format !== 'realValue') {\n return enumOptionsValueForIndex<S>(value, enumOptions, emptyValue);\n }\n if (Array.isArray(value)) {\n return value.map((v) => decodeSingle(v, enumOptions, emptyValue));\n }\n return decodeSingle(value, enumOptions, emptyValue);\n}\n", "import isNil from 'lodash/isNil';\n\nimport type { OptionValueFormat } from './types';\n\n/** Encodes an enum option value into a string for a DOM value attribute.\n *\n * When `format` is `'realValue'`, primitive values are converted via `String()`.\n * Non-primitive values (objects, arrays) fall back to the index since\n * `String()` would produce `\"[object Object]\"`.\n *\n * When `format` is `'indexed'` (the default), returns the index as a string.\n *\n * @param value - The typed enum value\n * @param index - The option's position in the enumOptions array\n * @param [format='indexed'] - How to encode the value for the DOM attribute\n * @returns The string to use as the DOM value attribute\n */\nexport default function enumOptionValueEncoder(\n value: unknown,\n index: number,\n format: OptionValueFormat = 'indexed',\n): string {\n if (format !== 'realValue') {\n return String(index);\n }\n if (isNil(value)) {\n return '';\n }\n if (typeof value === 'object') {\n return String(index);\n }\n return String(value);\n}\n", "import baseClone from './_baseClone.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n}\n\nexport default cloneDeep;\n", "import baseSet from './_baseSet.js';\n\n/**\n * This method is like `_.set` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.setWith(object, '[0][1]', 'a', Object);\n * // => { '0': { '1': 'a' } }\n */\nfunction setWith(object, path, value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseSet(object, path, value, customizer);\n}\n\nexport default setWith;\n", "import cloneDeep from 'lodash/cloneDeep';\nimport get from 'lodash/get';\nimport set from 'lodash/set';\nimport setWith from 'lodash/setWith';\n\nimport { ERRORS_KEY } from './constants';\nimport type { ErrorSchema, FieldPathList } from './types';\n\n/** Represents the type of the path which can be a string of dotted path values or a list of string or numbers where\n * numbers represent array indexes/\n */\nexport type PathType = string | FieldPathList;\n\n/** The `ErrorSchemaBuilder<T>` is used to build an `ErrorSchema<T>` since the definition of the `ErrorSchema` type is\n * designed for reading information rather than writing it. Use this class to add, replace or clear errors in an error\n * schema by using either dotted path or an array of path names. Once you are done building the `ErrorSchema`, you can\n * get the result and/or reset all the errors back to an initial set and start again.\n */\nexport default class ErrorSchemaBuilder<T = any> {\n /** The error schema being built\n *\n * @private\n */\n private errorSchema: ErrorSchema<T> = {};\n\n /** Construct an `ErrorSchemaBuilder` with an optional initial set of errors in an `ErrorSchema`.\n *\n * @param [initialSchema] - The optional set of initial errors, that will be cloned into the class\n */\n constructor(initialSchema?: ErrorSchema<T>) {\n this.resetAllErrors(initialSchema);\n }\n\n /** Returns the `ErrorSchema` that has been updated by the methods of the `ErrorSchemaBuilder`\n */\n get ErrorSchema() {\n return this.errorSchema;\n }\n\n /** Will get an existing `ErrorSchema` at the specified `pathOfError` or create and return one.\n *\n * @param [pathOfError] - The optional path into the `ErrorSchema` at which to add the error(s)\n * @returns - The error block for the given `pathOfError` or the root if not provided\n * @private\n */\n private getOrCreateErrorBlock(pathOfError?: PathType) {\n const hasPath = (Array.isArray(pathOfError) && pathOfError.length > 0) || typeof pathOfError === 'string';\n // @ts-expect-error TS2590 to avoid \"Expression produces a union type that is too complex to represent\" error\n let errorBlock: ErrorSchema = hasPath ? get(this.errorSchema, pathOfError) : this.errorSchema;\n if (!errorBlock && pathOfError) {\n errorBlock = {};\n setWith(this.errorSchema, pathOfError, errorBlock, Object);\n }\n return errorBlock;\n }\n\n /** Resets all errors in the `ErrorSchemaBuilder` back to the `initialSchema` if provided, otherwise an empty set.\n *\n * @param [initialSchema] - The optional set of initial errors, that will be cloned into the class\n * @returns - The `ErrorSchemaBuilder` object for chaining purposes\n */\n resetAllErrors(initialSchema?: ErrorSchema<T>) {\n this.errorSchema = initialSchema ? cloneDeep(initialSchema) : {};\n return this;\n }\n\n /** Adds the `errorOrList` to the list of errors in the `ErrorSchema` at either the root level or the location within\n * the schema described by the `pathOfError`. For more information about how to specify the path see the\n * [eslint lodash plugin docs](https://github.com/wix/eslint-plugin-lodash/blob/master/docs/rules/path-style.md).\n *\n * @param errorOrList - The error or list of errors to add into the `ErrorSchema`\n * @param [pathOfError] - The optional path into the `ErrorSchema` at which to add the error(s)\n * @returns - The `ErrorSchemaBuilder` object for chaining purposes\n */\n addErrors(errorOrList: string | string[], pathOfError?: PathType) {\n const errorBlock: ErrorSchema = this.getOrCreateErrorBlock(pathOfError);\n let errorsList = get(errorBlock, ERRORS_KEY);\n if (!Array.isArray(errorsList)) {\n errorsList = [];\n errorBlock[ERRORS_KEY] = errorsList;\n }\n\n if (Array.isArray(errorOrList)) {\n set(errorBlock, ERRORS_KEY, [...new Set([...errorsList, ...errorOrList])]);\n } else {\n set(errorBlock, ERRORS_KEY, [...new Set([...errorsList, errorOrList])]);\n }\n return this;\n }\n\n /** Sets/replaces the `errorOrList` as the error(s) in the `ErrorSchema` at either the root level or the location\n * within the schema described by the `pathOfError`. For more information about how to specify the path see the\n * [eslint lodash plugin docs](https://github.com/wix/eslint-plugin-lodash/blob/master/docs/rules/path-style.md).\n *\n * @param errorOrList - The error or list of errors to set into the `ErrorSchema`\n * @param [pathOfError] - The optional path into the `ErrorSchema` at which to set the error(s)\n * @returns - The `ErrorSchemaBuilder` object for chaining purposes\n */\n setErrors(errorOrList: string | string[], pathOfError?: PathType) {\n const errorBlock: ErrorSchema = this.getOrCreateErrorBlock(pathOfError);\n // Effectively clone the array being given to prevent accidental outside manipulation of the given list\n const listToAdd = Array.isArray(errorOrList) ? [...new Set([...errorOrList])] : [errorOrList];\n set(errorBlock, ERRORS_KEY, listToAdd);\n return this;\n }\n\n /** Clears the error(s) in the `ErrorSchema` at either the root level or the location within the schema described by\n * the `pathOfError`. For more information about how to specify the path see the\n * [eslint lodash plugin docs](https://github.com/wix/eslint-plugin-lodash/blob/master/docs/rules/path-style.md).\n *\n * @param [pathOfError] - The optional path into the `ErrorSchema` at which to clear the error(s)\n * @returns - The `ErrorSchemaBuilder` object for chaining purposes\n */\n clearErrors(pathOfError?: PathType) {\n const errorBlock: ErrorSchema = this.getOrCreateErrorBlock(pathOfError);\n set(errorBlock, ERRORS_KEY, []);\n return this;\n }\n}\n", "import SetCache from './_SetCache.js';\nimport arrayIncludes from './_arrayIncludes.js';\nimport arrayIncludesWith from './_arrayIncludesWith.js';\nimport arrayMap from './_arrayMap.js';\nimport baseUnary from './_baseUnary.js';\nimport cacheHas from './_cacheHas.js';\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * The base implementation of methods like `_.difference` without support\n * for excluding multiple arrays or iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Array} values The values to exclude.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n */\nfunction baseDifference(array, values, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n isCommon = true,\n length = array.length,\n result = [],\n valuesLength = values.length;\n\n if (!length) {\n return result;\n }\n if (iteratee) {\n values = arrayMap(values, baseUnary(iteratee));\n }\n if (comparator) {\n includes = arrayIncludesWith;\n isCommon = false;\n }\n else if (values.length >= LARGE_ARRAY_SIZE) {\n includes = cacheHas;\n isCommon = false;\n values = new SetCache(values);\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee == null ? value : iteratee(value);\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var valuesIndex = valuesLength;\n while (valuesIndex--) {\n if (values[valuesIndex] === computed) {\n continue outer;\n }\n }\n result.push(value);\n }\n else if (!includes(values, computed, comparator)) {\n result.push(value);\n }\n }\n return result;\n}\n\nexport default baseDifference;\n", "import baseDifference from './_baseDifference.js';\nimport baseFlatten from './_baseFlatten.js';\nimport baseRest from './_baseRest.js';\nimport isArrayLikeObject from './isArrayLikeObject.js';\n\n/**\n * Creates an array of `array` values not included in the other given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * **Note:** Unlike `_.pullAll`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.without, _.xor\n * @example\n *\n * _.difference([2, 1], [2, 3]);\n * // => [1]\n */\nvar difference = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))\n : [];\n});\n\nexport default difference;\n", "import arrayMap from './_arrayMap.js';\nimport baseIteratee from './_baseIteratee.js';\nimport basePickBy from './_basePickBy.js';\nimport getAllKeysIn from './_getAllKeysIn.js';\n\n/**\n * Creates an object composed of the `object` properties `predicate` returns\n * truthy for. The predicate is invoked with two arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pickBy(object, _.isNumber);\n * // => { 'a': 1, 'c': 3 }\n */\nfunction pickBy(object, predicate) {\n if (object == null) {\n return {};\n }\n var props = arrayMap(getAllKeysIn(object), function(prop) {\n return [prop];\n });\n predicate = baseIteratee(predicate);\n return basePickBy(object, props, function(value, path) {\n return predicate(value, path[0]);\n });\n}\n\nexport default pickBy;\n", "import difference from 'lodash/difference';\nimport get from 'lodash/get';\nimport isPlainObject from 'lodash/isPlainObject';\nimport keys from 'lodash/keys';\nimport pickBy from 'lodash/pickBy';\n\nimport deepEquals from './deepEquals';\n\n/**\n * Compares two objects and returns the names of the fields that have changed.\n * This function iterates over each field of object `a`, using `_.isEqual` to compare the field value\n * with the corresponding field value in object `b`. If the values are different, the field name will\n * be included in the returned array.\n *\n * @param a - The first object, representing the original data to compare.\n * @param b - The second object, representing the updated data to compare.\n * @returns - An array of field names that have changed.\n *\n * @example\n * const a = { name: 'John', age: 30 };\n * const b = { name: 'John', age: 31 };\n * const changedFields = getChangedFields(a, b);\n * console.log(changedFields); // Output: ['age']\n */\nexport default function getChangedFields(a: unknown, b: unknown): string[] {\n const aIsPlainObject = isPlainObject(a);\n const bIsPlainObject = isPlainObject(b);\n // If strictly equal or neither of them is a plainObject returns an empty array\n if (a === b || (!aIsPlainObject && !bIsPlainObject)) {\n return [];\n }\n if (aIsPlainObject && !bIsPlainObject) {\n return keys(a);\n }\n if (!aIsPlainObject && bIsPlainObject) {\n return keys(b);\n }\n const unequalFields = keys(pickBy(a as object, (value, key) => !deepEquals(value, get(b, key))));\n const diffFields = difference(keys(b), keys(a));\n return [...unequalFields, ...diffFields];\n}\n", "import type { DateObject } from './types';\n\n/** Available options for re-ordering date input element */\nexport type DateElementFormat = 'DMY' | 'MDY' | 'YMD';\n\n/** Type describing format of DateElement prop */\nexport interface DateElementProp {\n type: string;\n range: [number, number];\n value: number | undefined;\n}\n\n/** Given date & time information with optional yearRange & format, returns props for DateElement\n *\n * @param date - Object containing date with optional time information\n * @param time - Determines whether to include time or not\n * @param [yearRange=[1900, new Date().getFullYear() + 2]] - Controls the list of years to be displayed\n * @param [format='YMD'] - Controls the order in which day, month and year input element will be displayed\n * @returns Array of props for DateElement\n */\n\nexport default function getDateElementProps(\n date: DateObject,\n time: boolean,\n yearRange: [number, number] = [1900, new Date().getFullYear() + 2],\n format: DateElementFormat = 'YMD',\n) {\n const { day, month, year, hour, minute, second } = date;\n\n const dayObj: DateElementProp = { type: 'day', range: [1, 31], value: day };\n const monthObj: DateElementProp = { type: 'month', range: [1, 12], value: month };\n const yearObj: DateElementProp = { type: 'year', range: yearRange, value: year };\n\n const dateElementProp: DateElementProp[] = [];\n switch (format) {\n case 'MDY':\n dateElementProp.push(monthObj, dayObj, yearObj);\n break;\n case 'DMY':\n dateElementProp.push(dayObj, monthObj, yearObj);\n break;\n case 'YMD':\n default:\n dateElementProp.push(yearObj, monthObj, dayObj);\n }\n\n if (time) {\n dateElementProp.push(\n { type: 'hour', range: [0, 23], value: hour },\n { type: 'minute', range: [0, 59], value: minute },\n { type: 'second', range: [0, 59], value: second },\n );\n }\n\n return dateElementProp;\n}\n", "import type { RangeSpecType, RJSFSchema, StrictRJSFSchema } from './types';\n\n/** Extracts the range spec information `{ step?: number, min?: number, max?: number }` that can be spread onto an HTML\n * input from the range analog in the schema `{ multipleOf?: number, minimum?: number, maximum?: number }`.\n *\n * @param schema - The schema from which to extract the range spec\n * @returns - A range specification from the schema\n */\nexport default function rangeSpec<S extends StrictRJSFSchema = RJSFSchema>(schema: S) {\n const spec: RangeSpecType = {};\n if (schema.multipleOf) {\n spec.step = schema.multipleOf;\n }\n if (schema.minimum || schema.minimum === 0) {\n spec.min = schema.minimum;\n }\n if (schema.maximum || schema.maximum === 0) {\n spec.max = schema.maximum;\n }\n return spec;\n}\n", "import rangeSpec from './rangeSpec';\nimport type { FormContextType, InputPropsType, RJSFSchema, StrictRJSFSchema, UIOptionsType } from './types';\n\n/** Using the `schema`, `defaultType` and `options`, extract out the props for the <input> element that make sense.\n *\n * @param schema - The schema for the field provided by the widget\n * @param [defaultType] - The default type, if any, for the field provided by the widget\n * @param [options={}] - The UI Options for the field provided by the widget\n * @param [autoDefaultStepAny=true] - Determines whether to auto-default step=any when the type is number and no step\n * @returns - The extracted `InputPropsType` object\n */\nexport default function getInputProps<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n schema: RJSFSchema,\n defaultType?: string,\n options: UIOptionsType<T, S, F> = {},\n autoDefaultStepAny = true,\n): InputPropsType {\n const inputProps: InputPropsType = {\n type: defaultType || 'text',\n ...rangeSpec(schema),\n };\n\n // If options.inputType is set use that as the input type\n if (options.inputType) {\n inputProps.type = options.inputType;\n } else if (!defaultType) {\n // If the schema is of type number or integer, set the input type to number\n if (schema.type === 'number') {\n inputProps.type = 'number';\n // Only add step if one isn't already defined and we are auto-defaulting the \"any\" step\n if (autoDefaultStepAny && inputProps.step === undefined) {\n // Setting step to 'any' fixes a bug in Safari where decimals are not\n // allowed in number inputs\n inputProps.step = 'any';\n }\n } else if (schema.type === 'integer') {\n inputProps.type = 'number';\n // Only add step if one isn't already defined\n if (inputProps.step === undefined) {\n // Since this is integer, you always want to step up or down in multiples of 1\n inputProps.step = 1;\n }\n }\n }\n\n // For date/time input types, propagate formatMinimum/formatMaximum to min/max\n if (['date', 'datetime-local', 'time', 'week', 'month'].includes(inputProps.type)) {\n if (schema.formatMinimum !== undefined) {\n inputProps.min = schema.formatMinimum as string;\n }\n if (schema.formatMaximum !== undefined) {\n inputProps.max = schema.formatMaximum as string;\n }\n }\n\n if (options.autocomplete) {\n inputProps.autoComplete = options.autocomplete;\n }\n\n if (options.accept) {\n inputProps.accept = options.accept as string;\n }\n\n return inputProps;\n}\n", "import type { OptionValueFormat } from './types';\n\n/** Resolves the effective `optionValueFormat` for enum-backed widgets.\n *\n * Provides a single source of truth for the default DOM encoding format\n * (`'indexed'`) used by `SelectWidget`, `RadioWidget`, and `CheckboxesWidget`.\n * Widgets should call this helper once and pass the result to\n * `enumOptionValueEncoder`, `enumOptionValueDecoder`, and `enumOptionSelectedValue`\n * rather than reading `options.optionValueFormat` directly.\n *\n * @param options - The widget options (typically from the `options` prop, already\n * resolved from `ui:options` and `ui:globalOptions`)\n * @returns The resolved `OptionValueFormat`, defaulting to `'indexed'` when not set\n */\nexport default function getOptionValueFormat(options?: { optionValueFormat?: OptionValueFormat }): OptionValueFormat {\n return options?.optionValueFormat ?? 'indexed';\n}\n", "import { SUBMIT_BTN_OPTIONS_KEY } from './constants';\nimport getUiOptions from './getUiOptions';\nimport type { FormContextType, RJSFSchema, StrictRJSFSchema, UiSchema, UISchemaSubmitButtonOptions } from './types';\n\n/** The default submit button options, exported for testing purposes\n */\nexport const DEFAULT_OPTIONS: UISchemaSubmitButtonOptions = {\n props: {\n disabled: false,\n },\n submitText: 'Submit',\n norender: false,\n};\n\n/** Extracts any `ui:submitButtonOptions` from the `uiSchema` and merges them onto the `DEFAULT_OPTIONS`\n *\n * @param [uiSchema={}] - the UI Schema from which to extract submit button props\n * @returns - The merging of the `DEFAULT_OPTIONS` with any custom ones\n */\nexport default function getSubmitButtonOptions<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(uiSchema: UiSchema<T, S, F> = {}): UISchemaSubmitButtonOptions {\n const uiOptions = getUiOptions<T, S, F>(uiSchema);\n if (uiOptions?.[SUBMIT_BTN_OPTIONS_KEY]) {\n const options = uiOptions[SUBMIT_BTN_OPTIONS_KEY];\n return { ...DEFAULT_OPTIONS, ...options };\n }\n\n return DEFAULT_OPTIONS;\n}\n", "import type { FormContextType, TemplatesType, Registry, UIOptionsType, StrictRJSFSchema, RJSFSchema } from './types';\n\n/** Returns the template with the given `name` from either the `uiSchema` if it is defined or from the `registry`\n * otherwise. NOTE, since `ButtonTemplates` are not overridden in `uiSchema` only those in the `registry` are returned.\n *\n * @param name - The name of the template to fetch, restricted to the keys of `TemplatesType`\n * @param registry - The `Registry` from which to read the template\n * @param [uiOptions={}] - The `UIOptionsType` from which to read an alternate template\n * @returns - The template from either the `uiSchema` or `registry` for the `name`\n */\nexport default function getTemplate<\n Name extends keyof TemplatesType<T, S, F>,\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(name: Name, registry: Registry<T, S, F>, uiOptions: UIOptionsType<T, S, F> = {}): TemplatesType<T, S, F>[Name] {\n const { templates } = registry;\n if (name === 'ButtonTemplates') {\n return templates[name];\n }\n // Allow templates to be customized per-field by using string keys from the registry\n if (\n Object.hasOwn(uiOptions, name) &&\n typeof uiOptions[name] === 'string' &&\n Object.hasOwn(templates, uiOptions[name] as string)\n ) {\n const key = uiOptions[name];\n // Evaluating templates[key] results in TS2590: Expression produces a union type that is too complex to represent\n // To avoid that, we cast templates to `any` before accessing the key field\n return (templates as any)[key];\n }\n return (\n // Evaluating uiOptions[name] results in TS2590: Expression produces a union type that is too complex to represent\n // To avoid that, we cast uiOptions to `any` before accessing the name field\n ((uiOptions as any)[name] as TemplatesType<T, S, F>[Name]) || templates[name]\n );\n}\n", "import toString from './toString.js';\n\n/** Used to generate unique IDs. */\nvar idCounter = 0;\n\n/**\n * Generates a unique ID. If `prefix` is given, the ID is appended to it.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {string} [prefix=''] The value to prefix the ID with.\n * @returns {string} Returns the unique ID.\n * @example\n *\n * _.uniqueId('contact_');\n * // => 'contact_104'\n *\n * _.uniqueId();\n * // => '105'\n */\nfunction uniqueId(prefix) {\n var id = ++idCounter;\n return toString(prefix) + id;\n}\n\nexport default uniqueId;\n", "import get from 'lodash/get';\nimport uniqueId from 'lodash/uniqueId';\n\nimport type { TestIdShape } from './types';\n\n/** Returns an object of test IDs that can only be used in test mode. If the function is called in a test environment\n * (`NODE_ENV === 'test'`, this is set by vitest) then a Proxy object will be returned. If a key within the returned\n * object is accessed, if the value already exists the object will return that value, otherwise it will create that key\n * with a generated `uuid` value and return the generated ID. If it is called outside of a test environment, the\n * function will return an empty object, therefore returning `undefined` for any property within the object and\n * excluding the prop from the rendered output of the component in which it is used.\n * This implementation was adapted from the following blog post: https://www.matthewsessions.com/blog/react-test-id/\n * To use this helper, you will want to generate a separate object for each component to avoid potential overlapping of\n * ID names. You will also want to export the object for use in tests, because the keys will be generated in the\n * component file, and used in the test file. Within the component file, add:\n * `export const TEST_IDS = getTestIds();`\n * Then pass `TEST_IDS.examplePropertyName` as the value of the test ID attribute of the intended component. This will\n * allow you to use `TEST_IDS.examplePropertyName` within your tests, while keeping the test IDs out of your rendered\n * output.\n */\nexport default function getTestIds(): TestIdShape {\n // For some reason, even though process.env contains the value of `test` for NODE_ENV, accessing it directly returns\n // 'development'. Using `get()` does, in fact, return test so sticking with it.\n // Use globalThis to access process without requiring @types/node (TS6 compatibility).\n if (get(globalThis, 'process.env.NODE_ENV') !== 'test') {\n return {};\n }\n\n const ids = new Map();\n return new Proxy(\n {},\n {\n get(_obj, prop) {\n if (!ids.has(prop)) {\n ids.set(prop, uniqueId('test-id-'));\n }\n return ids.get(prop);\n },\n },\n );\n}\n", "import { createElement } from 'react';\nimport get from 'lodash/get';\nimport set from 'lodash/set';\nimport ReactIs from 'react-is';\n\nimport getSchemaType from './getSchemaType';\nimport type { FormContextType, RJSFSchema, Widget, RegistryWidgetsType, StrictRJSFSchema } from './types';\n\n/** The map of schema types to widget type to widget name\n */\nconst widgetMap: Record<string, Record<string, string>> = {\n boolean: {\n checkbox: 'CheckboxWidget',\n radio: 'RadioWidget',\n select: 'SelectWidget',\n hidden: 'HiddenWidget',\n },\n string: {\n text: 'TextWidget',\n password: 'PasswordWidget',\n email: 'EmailWidget',\n hostname: 'TextWidget',\n ipv4: 'TextWidget',\n ipv6: 'TextWidget',\n uri: 'URLWidget',\n 'data-url': 'FileWidget',\n radio: 'RadioWidget',\n select: 'SelectWidget',\n textarea: 'TextareaWidget',\n hidden: 'HiddenWidget',\n date: 'DateWidget',\n datetime: 'DateTimeWidget',\n 'date-time': 'DateTimeWidget',\n 'alt-date': 'AltDateWidget',\n 'alt-datetime': 'AltDateTimeWidget',\n time: 'TimeWidget',\n color: 'ColorWidget',\n file: 'FileWidget',\n },\n number: {\n text: 'TextWidget',\n select: 'SelectWidget',\n updown: 'UpDownWidget',\n range: 'RangeWidget',\n radio: 'RadioWidget',\n hidden: 'HiddenWidget',\n },\n integer: {\n text: 'TextWidget',\n select: 'SelectWidget',\n updown: 'UpDownWidget',\n range: 'RangeWidget',\n radio: 'RadioWidget',\n hidden: 'HiddenWidget',\n },\n array: {\n select: 'SelectWidget',\n checkboxes: 'CheckboxesWidget',\n files: 'FileWidget',\n hidden: 'HiddenWidget',\n },\n};\n\n/** Wraps the given widget with stateless functional component that will merge any `defaultProps.options` with the\n * `options` that are provided in the props. It will add the wrapper component as a `MergedWidget` property onto the\n * `Widget` so that future attempts to wrap `AWidget` will return the already existing wrapper.\n *\n * @param AWidget - A widget that will be wrapped or one that is already wrapped\n * @returns - The wrapper widget\n */\nfunction mergeWidgetOptions<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n AWidget: Widget<T, S, F>,\n) {\n let MergedWidget: Widget<T, S, F> | undefined = get(AWidget, 'MergedWidget');\n // cache return value as property of widget for proper react reconciliation\n if (!MergedWidget) {\n // oxlint-disable-next-line typescript/no-deprecated\n const defaultOptions = AWidget.defaultProps?.options || {};\n MergedWidget = ({ options, ...props }) => <AWidget options={{ ...defaultOptions, ...options }} {...props} />;\n set(AWidget, 'MergedWidget', MergedWidget);\n }\n return MergedWidget;\n}\n\n/** Given a schema representing a field to render and either the name or actual `Widget` implementation, returns the\n * React component that is used to render the widget. If the `widget` is already a React component, then it is wrapped\n * with a `MergedWidget`. Otherwise an attempt is made to look up the widget inside of the `registeredWidgets` map based\n * on the schema type and `widget` name. If no widget component can be found an `Error` is thrown.\n *\n * @param schema - The schema for the field\n * @param [widget] - Either the name of the widget OR a `Widget` implementation to use\n * @param [registeredWidgets={}] - A registry of widget name to `Widget` implementation\n * @returns - The `Widget` component to use\n * @throws - An error if there is no `Widget` component that can be returned\n */\nexport default function getWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n schema: RJSFSchema,\n widget?: Widget<T, S, F> | string,\n registeredWidgets: RegistryWidgetsType<T, S, F> = {},\n): Widget<T, S, F> {\n const type = getSchemaType(schema);\n\n if (\n typeof widget === 'function' ||\n (widget && ReactIs.isForwardRef(createElement(widget))) ||\n ReactIs.isMemo(widget)\n ) {\n return mergeWidgetOptions<T, S, F>(widget as Widget<T, S, F>);\n }\n\n if (typeof widget !== 'string') {\n throw new Error(`Unsupported widget definition: ${typeof widget} in schema: ${JSON.stringify(schema)}`);\n }\n\n if (widget in registeredWidgets) {\n const registeredWidget = registeredWidgets[widget];\n return getWidget<T, S, F>(schema, registeredWidget, registeredWidgets);\n }\n\n if (typeof type === 'string') {\n if (!(type in widgetMap)) {\n throw new Error(`No widget for type '${type}' in schema: ${JSON.stringify(schema)}`);\n }\n\n if (widget in widgetMap[type]) {\n const registeredWidget = registeredWidgets[widgetMap[type][widget]];\n return getWidget<T, S, F>(schema, registeredWidget, registeredWidgets);\n }\n }\n\n throw new Error(`No widget '${widget}' for type '${type}' in schema: ${JSON.stringify(schema)}`);\n}\n", "import type { RJSFSchema, StrictRJSFSchema } from './types';\n\n/** Hashes a string using the algorithm based on Java's hashing function.\n * JS has no built-in hashing function, so rolling our own\n * based on Java's hashing fn:\n * http://www.java2s.com/example/nodejs-utility-method/string-hash/hashcode-4dc2b.html\n *\n * @param string - The string for which to get the hash\n * @returns - The resulting hash of the string in hex format\n */\nexport function hashString(string: string): string {\n let hash = 0;\n for (let i = 0; i < string.length; i++) {\n const chr = string.charCodeAt(i);\n // oxlint-disable-next-line no-bitwise\n hash = (hash << 5) - hash + chr;\n // oxlint-disable-next-line no-bitwise\n hash &= hash; // Convert to 32bit integer\n }\n return hash.toString(16);\n}\n\n/** Recursively serializes a value to JSON with object keys sorted alphabetically to produce\n * a stable string representation.\n *\n * @param object - The object for which the sorted stringify is desired\n * @returns - The stringified object with keys sorted in a consistent order\n */\nexport function sortedJSONStringify(object: unknown): string {\n function shouldIncludeValue(value: unknown) {\n return value !== undefined && typeof value !== 'function' && typeof value !== 'symbol';\n }\n\n if (Array.isArray(object)) {\n return `[${object.map((x) => (x === undefined ? 'undefined' : sortedJSONStringify(x))).join(',')}]`;\n }\n if (object === null || typeof object !== 'object') {\n return JSON.stringify(typeof object === 'function' ? null : object); // Normalise functions\n }\n\n const record = object as Record<string, unknown>;\n const sortedValues = Object.keys(record)\n .sort()\n .filter((key) => shouldIncludeValue(record[key]))\n .map((key) => `${JSON.stringify(key)}:${sortedJSONStringify(record[key])}`);\n return `{${sortedValues.join(',')}}`;\n}\n\n/** Stringifies an `object` and returns the hash of the resulting string. Sorts object fields\n * in consistent order before stringify to prevent different hash ids for the same object.\n *\n * @param object - The object for which the hash is desired\n * @returns - The string obtained from the hash of the stringified object\n */\nexport function hashObject(object: unknown): string {\n return hashString(sortedJSONStringify(object));\n}\n\n/** Stringifies the schema and returns the hash of the resulting string. Sorts schema fields\n * in consistent order before stringify to prevent different hash ids for the same schema.\n * Symbol-keyed properties (RJSF_REF_KEY, RJSF_REF_CYCLE_KEY, ADDITIONAL_PROPERTY_FLAG) are\n * automatically excluded by JSON.stringify, so no special filtering is needed.\n *\n * @param schema - The schema for which the hash is desired\n * @returns - The string obtained from the hash of the stringified schema\n */\nexport default function hashForSchema<S extends StrictRJSFSchema = RJSFSchema>(schema: S) {\n return hashString(sortedJSONStringify(schema));\n}\n", "import getWidget from './getWidget';\nimport type { FormContextType, RegistryWidgetsType, RJSFSchema, StrictRJSFSchema, Widget } from './types';\n\n/** Detects whether the `widget` exists for the `schema` with the associated `registryWidgets` and returns true if it\n * does, or false if it doesn't.\n *\n * @param schema - The schema for the field\n * @param widget - Either the name of the widget OR a `Widget` implementation to use\n * @param [registeredWidgets={}] - A registry of widget name to `Widget` implementation\n * @returns - True if the widget exists, false otherwise\n */\nexport default function hasWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n schema: RJSFSchema,\n widget: Widget<T, S, F> | string,\n registeredWidgets: RegistryWidgetsType<T, S, F> = {},\n) {\n try {\n getWidget(schema, widget, registeredWidgets);\n return true;\n } catch (e) {\n const err: Error = e as Error;\n if (err.message && (err.message.startsWith('No widget') || err.message.startsWith('Unsupported widget'))) {\n return false;\n }\n throw e;\n }\n}\n", "import isString from 'lodash/isString';\n\nimport { ID_KEY } from './constants';\nimport type { FieldPathId } from './types';\n\n/** Generates a consistent `id` pattern for a given `id` and a `suffix`\n *\n * @param id - Either simple string id or an FieldPathId from which to extract it\n * @param suffix - The suffix to append to the id\n */\nfunction idGenerator(id: FieldPathId | string, suffix: string) {\n const theId = isString(id) ? id : id[ID_KEY];\n return `${theId}__${suffix}`;\n}\n/** Return a consistent `id` for the field description element\n *\n * @param id - Either simple string id or an FieldPathId from which to extract it\n * @returns - The consistent id for the field description element from the given `id`\n */\nexport function descriptionId(id: FieldPathId | string) {\n return idGenerator(id, 'description');\n}\n\n/** Return a consistent `id` for the field error element\n *\n * @param id - Either simple string id or an FieldPathId from which to extract it\n * @returns - The consistent id for the field error element from the given `id`\n */\nexport function errorId(id: FieldPathId | string) {\n return idGenerator(id, 'error');\n}\n\n/** Return a consistent `id` for the field examples element\n *\n * @param id - Either simple string id or an FieldPathId from which to extract it\n * @returns - The consistent id for the field examples element from the given `id`\n */\nexport function examplesId(id: FieldPathId | string) {\n return idGenerator(id, 'examples');\n}\n\n/** Return a consistent `id` for the field help element\n *\n * @param id - Either simple string id or an FieldPathId from which to extract it\n * @returns - The consistent id for the field help element from the given `id`\n */\nexport function helpId(id: FieldPathId | string) {\n return idGenerator(id, 'help');\n}\n\n/** Return a consistent `id` for the field title element\n *\n * @param id - Either simple string id or an FieldPathId from which to extract it\n * @returns - The consistent id for the field title element from the given `id`\n */\nexport function titleId(id: FieldPathId | string) {\n return idGenerator(id, 'title');\n}\n\n/** Return a list of element ids that contain additional information about the field that can be used to as the aria\n * description of the field. This is correctly omitting `titleId` which would be \"labeling\" rather than \"describing\" the\n * element.\n *\n * @param id - Either simple string id or an FieldPathId from which to extract it\n * @param [includeExamples=false] - Optional flag, if true, will add the `examplesId` into the list\n * @returns - The string containing the list of ids for use in an `aria-describedBy` attribute\n */\nexport function ariaDescribedByIds(id: FieldPathId | string, includeExamples = false) {\n const examples = includeExamples ? ` ${examplesId(id)}` : '';\n return `${errorId(id)} ${descriptionId(id)} ${helpId(id)}${examples}`;\n}\n\n/** Return a consistent `id` for the `optionIndex`s of a `Radio` or `Checkboxes` widget\n *\n * @param id - The id of the parent component for the option\n * @param optionIndex - The index of the option for which the id is desired\n * @returns - An id for the option index based on the parent `id`\n */\nexport function optionId(id: string, optionIndex: number) {\n return `${id}-${optionIndex}`;\n}\n\n/** Return a consistent `id` for the `btn` button element\n *\n * @param id - The id of the parent component for the option\n * @param btn - The button type for which to generate the id\n * @returns - The consistent id for the button from the given `id` and `btn` type\n */\nexport function buttonId(id: FieldPathId | string, btn: 'add' | 'copy' | 'moveDown' | 'moveUp' | 'remove') {\n return idGenerator(id, btn);\n}\n\n/** Return a consistent `id` for the optional data controls `element`\n *\n * @param id - The id of the parent component for the option\n * @param element - The element type for which to generate the id\n * @returns - The consistent id for the optional data controls element from the given `id` and `element` type\n */\nexport function optionalControlsId(id: FieldPathId | string, element: 'Add' | 'Msg' | 'Remove') {\n return idGenerator(id, `optional${element}`);\n}\n", "import isEmpty from 'lodash/isEmpty';\nimport isNil from 'lodash/isNil';\nimport isObject from 'lodash/isObject';\n\n/** Determines whether the given `formData` represents valid form data, such as a primitive type, an array, or a\n * non-empty object.\n *\n * @param formData - The data to check\n * @returns - True if `formData` is not undefined, null, a primitive type or an array or an empty object\n */\nexport default function isFormDataAvailable<T = any>(formData?: T): boolean {\n return !isNil(formData) && (!isObject(formData) || Array.isArray(formData) || !isEmpty(formData));\n}\n", "import { REF_KEY } from './constants';\nimport deepEquals from './deepEquals';\nimport type { FormContextType, Registry, RJSFSchema, StrictRJSFSchema } from './types';\n\n/** Helper to check whether a JSON schema object is the root schema. The schema is a root schema with root `properties`\n * key or a root `$ref` key. If the `schemaToCompare` has a root `oneOf` property, the function will\n * return false. Else if `schemaToCompare` and `rootSchema` are the same object or equal, the function will return\n * `true`. Else if the `rootSchema` has a $ref, it will be resolved using `schemaUtils.resolveSchema` utility. If the\n * resolved schema matches the `schemaToCompare` the function will return `true`. Otherwise, it will return false.\n *\n * @param registry - The `Registry` used to get the `rootSchema` and `schemaUtils`\n * @param schemaToCompare - The JSON schema object to check. If `schemaToCompare` is an root schema, the\n * function will return true.\n * @returns - Flag indicating whether the `schemaToCompare` is the root schema\n */\nexport default function isRootSchema<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n registry: Registry<T, S, F>,\n schemaToCompare: S,\n): boolean {\n const { rootSchema, schemaUtils } = registry;\n if (deepEquals(schemaToCompare, rootSchema)) {\n return true;\n }\n if (REF_KEY in rootSchema) {\n const resolvedSchema = schemaUtils.retrieveSchema(rootSchema);\n return deepEquals(schemaToCompare, resolvedSchema);\n }\n return false;\n}\n", "import type { ReactElement } from 'react';\n\n/** Helper function that will return the value to use for a widget `label` based on `hideLabel`. The `fallback` is used\n * as the return value from the function when `hideLabel` is true. Due to the implementation of theme components, it\n * may be necessary to return something other than `undefined` to cause the theme component to not render a label. Some\n * themes require may `false` and others may require an empty string.\n *\n * @param [label] - The label string or component to render when not hidden\n * @param [hideLabel] - Flag, if true, will cause the label to be hidden\n * @param [fallback] - One of 3 values, `undefined` (the default), `false` or an empty string\n * @returns - `fallback` if `hideLabel` is true, otherwise `label`\n */\n\nexport default function labelValue(label?: string, hideLabel?: boolean, fallback?: ''): undefined | string;\nexport default function labelValue(label?: string, hideLabel?: boolean, fallback?: false): undefined | false | string;\nexport default function labelValue(label?: ReactElement, hideLabel?: boolean, fallback?: ''): undefined | ReactElement;\nexport default function labelValue(\n label?: ReactElement,\n hideLabel?: boolean,\n fallback?: false,\n): undefined | false | ReactElement;\nexport default function labelValue(\n label?: string | ReactElement,\n hideLabel?: boolean,\n fallback?: false | '',\n): undefined | false | string | ReactElement {\n return hideLabel ? fallback : label;\n}\n", "/** Converts a local Date string into a UTC date string\n *\n * @param dateString - The string representation of a date as accepted by the `Date()` constructor\n * @returns - A UTC date string if `dateString` is truthy, otherwise undefined\n */\nexport default function localToUTC(dateString: string) {\n return dateString ? new Date(dateString).toJSON() : undefined;\n}\n", "import enumOptionsIndexForValue from './enumOptionsIndexForValue';\nimport type { EnumOptionsType, RJSFSchema, StrictRJSFSchema } from './types';\n\n/** Logs a warning when a single-select enum widget has a schema default that is not one of its enum options.\n *\n * @param id - The field id used in the warning message\n * @param schema - The schema whose default value is checked\n * @param enumOptions - The enum options available to the widget\n * @param multiple - Whether the widget allows multiple selections\n */\nexport default function logUnsupportedDefaultForEnum<S extends StrictRJSFSchema = RJSFSchema>(\n id: string,\n schema: S,\n enumOptions?: EnumOptionsType<S>[],\n multiple = false,\n) {\n if (\n !multiple &&\n Array.isArray(enumOptions) &&\n schema.default !== undefined &&\n enumOptionsIndexForValue<S>(schema.default, enumOptions, multiple) === undefined\n ) {\n // oxlint-disable-next-line no-console\n console.error(\n `The schema default value \"${schema.default}\" is not one of the values in the enum options for \"${id}\"`,\n );\n }\n}\n", "import get from 'lodash/get';\nimport has from 'lodash/has';\n\nimport { FORM_CONTEXT_NAME, LOOKUP_MAP_NAME } from './constants';\nimport type { FormContextType, RJSFSchema, Registry, StrictRJSFSchema } from './types';\n\n/** Given a React JSON Schema Form registry or formContext object, return the value associated with `toLookup`. This\n * might be contained within the lookup map in the formContext. If no such value exists, return the `fallback`\n * value.\n *\n * @param regOrFc - The @rjsf registry or form context in which the lookup will occur\n * @param toLookup - The name of the field in the lookup map in the form context to get the value for\n * @param [fallback] - The fallback value to use if the form context does not contain a value for `toLookup`\n * @returns - The value associated with `toLookup` in the form context or `fallback`\n */\nexport default function lookupFromFormContext<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(regOrFc: Registry<T, S, F> | Registry<T, S, F>['formContext'], toLookup: string, fallback?: unknown) {\n const lookupPath = [LOOKUP_MAP_NAME];\n if (has(regOrFc, FORM_CONTEXT_NAME)) {\n lookupPath.unshift(FORM_CONTEXT_NAME);\n }\n return get(regOrFc, [...lookupPath, toLookup], fallback);\n}\n", "import type { GenericObjectType } from './types';\n\n/** Given a list of `properties` and an `order` list, returns a list that contains the `properties` ordered correctly.\n * If `order` is not an array, then the untouched `properties` list is returned. Otherwise `properties` is ordered per\n * the `order` list. If `order` contains a '*' then any `properties` that are not mentioned explicity in `order` will be\n * places in the location of the `*`.\n *\n * @param properties - The list of property keys to be ordered\n * @param order - An array of property keys to be ordered first, with an optional '*' property\n * @returns - A list with the `properties` ordered\n * @throws - Error when the properties cannot be ordered correctly\n */\nexport default function orderProperties(properties: string[], order?: string[]): string[] {\n if (!Array.isArray(order)) {\n return properties;\n }\n\n const arrayToHash = (arr: string[]) =>\n arr.reduce((acc: GenericObjectType, curr) => {\n acc[curr] = true;\n return acc;\n }, {});\n const errorPropList = (arr: string[]) =>\n arr.length > 1 ? `properties '${arr.join(\"', '\")}'` : `property '${arr[0]}'`;\n const propertyHash = arrayToHash(properties);\n const orderFiltered = order.filter((prop) => prop === '*' || propertyHash[prop]);\n const orderHash = arrayToHash(orderFiltered);\n\n const rest = properties.filter((prop: string) => !orderHash[prop]);\n const restIndex = orderFiltered.indexOf('*');\n if (restIndex === -1) {\n if (rest.length) {\n throw new Error(`uiSchema order list does not contain ${errorPropList(rest)}`);\n }\n return orderFiltered;\n }\n if (restIndex !== orderFiltered.lastIndexOf('*')) {\n throw new Error('uiSchema order list contains more than one wildcard item');\n }\n\n const complete = [...orderFiltered];\n complete.splice(restIndex, 1, ...rest);\n return complete;\n}\n", "import type { DateObject } from './types';\n\n/** Parses the `dateString` into a `DateObject`, including the time information when `includeTime` is true\n *\n * @param dateString - The date string to parse into a DateObject\n * @param [includeTime=true] - Optional flag, if false, will not include the time data into the object\n * @returns - The date string converted to a `DateObject`\n * @throws - Error when the date cannot be parsed from the string\n */\nexport default function parseDateString(dateString?: string, includeTime = true): DateObject {\n if (!dateString) {\n return {\n year: -1,\n month: -1,\n day: -1,\n hour: includeTime ? -1 : 0,\n minute: includeTime ? -1 : 0,\n second: includeTime ? -1 : 0,\n };\n }\n const date = new Date(dateString);\n if (Number.isNaN(date.getTime())) {\n throw new Error(`Unable to parse date ${dateString}`);\n }\n return {\n year: date.getUTCFullYear(),\n month: date.getUTCMonth() + 1, // oh you, javascript.\n day: date.getUTCDate(),\n hour: includeTime ? date.getUTCHours() : 0,\n minute: includeTime ? date.getUTCMinutes() : 0,\n second: includeTime ? date.getUTCSeconds() : 0,\n };\n}\n", "import isEmpty from 'lodash/isEmpty';\n\nimport { ANY_OF_KEY, ONE_OF_KEY, REF_KEY, RJSF_REF_KEY } from './constants';\nimport findSchemaDefinition from './findSchemaDefinition';\nimport mergeObjects from './mergeObjects';\nimport type {\n FormContextType,\n GenericObjectType,\n Registry,\n RJSFMarkedSchema,\n RJSFSchema,\n StrictRJSFSchema,\n UiSchema,\n} from './types';\n\n/** Resolves the uiSchema for a given schema, considering `ui:definitions` stored in the registry.\n *\n * Called at runtime for each field. When the schema contains a `$ref`, looks up the corresponding\n * uiSchema definition from `registry.uiSchemaDefinitions` and merges it with local overrides.\n * For schemas with `oneOf`/`anyOf` branches, also populates `uiSchema[keyword][i]` for branches\n * whose `$ref` matches a definition, so `MultiSchemaField` can read dropdown option titles.\n *\n * Resolution order (later sources override earlier):\n * 1. `ui:definitions[$ref]` - base definition from registry\n * 2. `localUiSchema` - local overrides at current path\n *\n * @param schema - The JSON schema (may contain `$ref` or `RJSF_REF_KEY`)\n * @param localUiSchema - The uiSchema at the current path (local overrides)\n * @param registry - The registry containing `uiSchemaDefinitions`\n * @returns - The resolved uiSchema with definitions merged in\n */\nexport default function resolveUiSchema<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(schema: S, localUiSchema: UiSchema<T, S, F> | undefined, registry: Registry<T, S, F>): UiSchema<T, S, F> {\n const ref = ((schema as RJSFMarkedSchema)[RJSF_REF_KEY] ?? schema[REF_KEY]) as string | undefined;\n const definitions = registry.uiSchemaDefinitions;\n const definitionUiSchema = ref && definitions ? definitions[ref] : undefined;\n\n let result: UiSchema<T, S, F>;\n if (!definitionUiSchema) {\n result = localUiSchema || {};\n } else if (!localUiSchema || isEmpty(localUiSchema)) {\n result = { ...definitionUiSchema };\n } else {\n result = mergeObjects(definitionUiSchema as GenericObjectType, localUiSchema as GenericObjectType) as UiSchema<\n T,\n S,\n F\n >;\n }\n\n // Walk oneOf/anyOf branches to populate uiSchema[keyword][i] so MultiSchemaField\n // can read dropdown option titles at the parent level.\n if (definitions) {\n let resolvedSchema: S = schema;\n if (ref && schema[REF_KEY] && !(schema as RJSFMarkedSchema)[RJSF_REF_KEY]) {\n try {\n resolvedSchema = findSchemaDefinition<S>(ref, registry.rootSchema);\n } catch (e) {\n // oxlint-disable-next-line no-console\n console.warn('could not resolve $ref in resolveUiSchema:\\n', e);\n return result;\n }\n }\n\n for (const keyword of [ONE_OF_KEY, ANY_OF_KEY] as const) {\n const schemaOptions = resolvedSchema[keyword];\n if (Array.isArray(schemaOptions) && schemaOptions.length > 0) {\n const currentUiSchemaArray = (result as GenericObjectType)[keyword];\n const uiSchemaArray: UiSchema<T, S, F>[] = Array.isArray(currentUiSchemaArray) ? [...currentUiSchemaArray] : [];\n\n let hasExpanded = false;\n for (let i = 0; i < schemaOptions.length; i++) {\n const option = schemaOptions[i] as GenericObjectType | undefined;\n const optionRef = ((option as RJSFMarkedSchema)?.[RJSF_REF_KEY] ?? option?.[REF_KEY]) as string | undefined;\n if (optionRef && optionRef in definitions) {\n const optionUiSchema = (uiSchemaArray[i] || {}) as GenericObjectType;\n uiSchemaArray[i] = mergeObjects(definitions[optionRef] as GenericObjectType, optionUiSchema) as UiSchema<\n T,\n S,\n F\n >;\n hasExpanded = true;\n }\n }\n\n if (hasExpanded) {\n (result as GenericObjectType)[keyword] = uiSchemaArray;\n }\n }\n }\n }\n\n return result;\n}\n", "import type { RJSFSchema, StrictRJSFSchema } from './types';\n\n/** Check to see if a `schema` specifies that a value must be true. This happens when:\n * - `schema.const` is truthy\n * - `schema.enum` == `[true]`\n * - `schema.anyOf` or `schema.oneOf` has a single value which recursively returns true\n * - `schema.allOf` has at least one value which recursively returns true\n *\n * @param schema - The schema to check\n * @returns - True if the schema specifies a value that must be true, false otherwise\n */\nexport default function schemaRequiresTrueValue<S extends StrictRJSFSchema = RJSFSchema>(schema: S): boolean {\n // Check if const is a truthy value\n if (schema.const) {\n return true;\n }\n\n // Check if an enum has a single value of true\n if (schema.enum?.length === 1 && schema.enum[0] === true) {\n return true;\n }\n\n // If anyOf has a single value, evaluate the subschema\n if (schema.anyOf?.length === 1) {\n return schemaRequiresTrueValue(schema.anyOf[0] as S);\n }\n\n // If oneOf has a single value, evaluate the subschema\n if (schema.oneOf?.length === 1) {\n return schemaRequiresTrueValue(schema.oneOf[0] as S);\n }\n\n // Evaluate each subschema in allOf, to see if one of them requires a true value\n if (schema.allOf) {\n const schemaSome = (subSchema: S['additionalProperties']) => schemaRequiresTrueValue(subSchema as S);\n return schema.allOf.some(schemaSome);\n }\n\n return false;\n}\n", "import enumOptionsIsSelected from './enumOptionsIsSelected';\nimport getTemplate from './getTemplate';\nimport getUiOptions from './getUiOptions';\nimport { descriptionId } from './idGenerators';\nimport type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from './types';\n\nexport type SelectedOptionDescriptionProps<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n> = Pick<WidgetProps<T, S, F>, 'id' | 'multiple' | 'options' | 'registry' | 'uiSchema' | 'value' | 'hideLabel'>;\n\n/** Renders the description associated with the selected oneOf or anyOf option in a single-select widget. */\nexport default function SelectedOptionDescription<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>({ hideLabel, id, multiple, options, registry, uiSchema, value }: SelectedOptionDescriptionProps<T, S, F>) {\n if (multiple || hideLabel) {\n return null;\n }\n\n const { label = true } = getUiOptions<T, S, F>(uiSchema, registry.globalUiOptions);\n if (!label) {\n return null;\n }\n\n const option = options.enumOptions?.find(({ value: enumValue }) => enumOptionsIsSelected(enumValue, value));\n const description = option?.schema?.description;\n if (!description) {\n return null;\n }\n\n const DescriptionFieldTemplate = getTemplate<'DescriptionFieldTemplate', T, S, F>(\n 'DescriptionFieldTemplate',\n registry,\n options,\n );\n return (\n <DescriptionFieldTemplate\n id={descriptionId(id)}\n description={description}\n schema={option.schema!}\n uiSchema={uiSchema}\n registry={registry}\n />\n );\n}\n", "/** Implements a shallow equals comparison that uses Object.is() for comparing values.\n * This function compares objects by checking if all keys and their values are equal using Object.is().\n *\n * @param a - The first element to compare\n * @param b - The second element to compare\n * @returns - True if the `a` and `b` are shallow equal, false otherwise\n */\nexport default function shallowEquals(a: any, b: any): boolean {\n // If they're the same reference, they're equal\n if (Object.is(a, b)) {\n return true;\n }\n\n // If either is null or undefined, they're not equal (since we know they're not the same reference)\n if (a == null || b == null) {\n return false;\n }\n\n // If they're not objects, they're not equal (since Object.is already checked)\n if (typeof a !== 'object' || typeof b !== 'object') {\n return false;\n }\n\n const keysA = Object.keys(a);\n const keysB = Object.keys(b);\n\n // Different number of keys means not equal\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n // Check if all keys and values are equal\n for (let i = 0; i < keysA.length; i += 1) {\n const key = keysA[i];\n if (!Object.hasOwn(b, key) || !Object.is(a[key], b[key])) {\n return false;\n }\n }\n\n return true;\n}\n", "import React from 'react';\n\nimport deepEquals from './deepEquals';\nimport shallowEquals from './shallowEquals';\n\n/** The supported component update strategies */\nexport type ComponentUpdateStrategy = 'customDeep' | 'shallow' | 'always';\n\n/** Determines whether the given `component` should be rerendered by comparing its current set of props and state\n * against the next set. The comparison strategy can be controlled via the `updateStrategy` parameter.\n *\n * @param component - A React component being checked\n * @param nextProps - The next set of props against which to check\n * @param nextState - The next set of state against which to check\n * @param updateStrategy - The strategy to use for comparison:\n * - 'customDeep': Uses RJSF's custom deep equality checks (default)\n * - 'shallow': Uses shallow comparison of props and state\n * - 'always': Always returns true (React's default behavior)\n * @returns - True if the component should be re-rendered, false otherwise\n */\nexport default function shouldRender(\n component: React.Component,\n nextProps: any,\n nextState: any,\n updateStrategy: ComponentUpdateStrategy = 'customDeep',\n) {\n if (updateStrategy === 'always') {\n // Use React's default behavior: always update if state or props change (no shouldComponentUpdate optimization)\n return true;\n }\n\n if (updateStrategy === 'shallow') {\n // Use shallow comparison for props and state\n const { props, state } = component;\n return !shallowEquals(props, nextProps) || !shallowEquals(state, nextState);\n }\n\n // Use custom deep equality checks (default 'customDeep' strategy)\n const { props, state } = component;\n return !deepEquals(props, nextProps) || !deepEquals(state, nextState);\n}\n", "import isObject from 'lodash/isObject';\nimport uniq from 'lodash/uniq';\n\nimport { ANY_OF_KEY, ONE_OF_KEY } from './constants';\nimport getSchemaType from './getSchemaType';\nimport getUiOptions from './getUiOptions';\nimport isRootSchema from './isRootSchema';\nimport type { FormContextType, Registry, RJSFSchema, StrictRJSFSchema, UiSchema } from './types';\n\n/** Returns the unique list of schema types for all of the options in a anyOf/oneOf\n *\n * @param schemas - The list of schemas representing the XxxOf options\n * @returns - All of the unique types contained within the oneOf list\n */\nexport function getSchemaTypesForXxxOf<S extends StrictRJSFSchema = RJSFSchema>(schemas: S[]): string | string[] {\n const allTypes: string[] = uniq(\n schemas\n .map((s) => (isObject(s) ? getSchemaType(s) : undefined))\n .flat()\n .filter((t) => t !== undefined),\n );\n return allTypes.length === 1 ? allTypes[0] : allTypes;\n}\n\n/** Determines whether the field information from the combination of `schema` and `required` along with the\n * `enableOptionalDataFieldForType` settings from the global UI options in the `registry` all indicate that this field\n * should be rendered with the Optional Data Controls UI.\n *\n * @param registry - The `registry` object\n * @param schema - The schema for the field\n * @param required - Flag indicating whether the field is required\n * @param [uiSchema] - The uiSchema for the field\n * @return - True if the field should be rendered with the optional field UI, otherwise false\n */\nexport default function shouldRenderOptionalField<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(registry: Registry<T, S, F>, schema: S, required: boolean, uiSchema?: UiSchema<T, S, F>): boolean {\n const { enableOptionalDataFieldForType = [] } = getUiOptions<T, S, F>(uiSchema, registry.globalUiOptions);\n let schemaType: ReturnType<typeof getSchemaType<S>>;\n if (ANY_OF_KEY in schema && Array.isArray(schema[ANY_OF_KEY])) {\n schemaType = getSchemaTypesForXxxOf<S>(schema[ANY_OF_KEY] as S[]);\n } else if (ONE_OF_KEY in schema && Array.isArray(schema[ONE_OF_KEY])) {\n schemaType = getSchemaTypesForXxxOf<S>(schema[ONE_OF_KEY] as S[]);\n } else {\n schemaType = getSchemaType<S>(schema);\n }\n return (\n !isRootSchema<T, S, F>(registry, schema) &&\n !required &&\n !!schemaType &&\n !Array.isArray(schemaType) &&\n !!enableOptionalDataFieldForType.find((val) => val === schemaType)\n );\n}\n", "import type { DateObject } from './types';\n\n/** Returns a UTC date string for the given `dateObject`. If `time` is false, then the time portion of the string is\n * removed.\n *\n * @param dateObject - The `DateObject` to convert to a date string\n * @param [time=true] - Optional flag used to remove the time portion of the date string if false\n * @returns - The UTC date string\n */\nexport default function toDateString(dateObject: DateObject, time = true) {\n const { year, month, day, hour = 0, minute = 0, second = 0 } = dateObject;\n const utcTime = Date.UTC(year, month - 1, day, hour, minute, second);\n const datetime = new Date(utcTime).toJSON();\n return time ? datetime : datetime.slice(0, 10);\n}\n", "import isPlainObject from 'lodash/isPlainObject';\n\nimport { ERRORS_KEY } from './constants';\nimport type { ErrorSchema, GenericObjectType, RJSFValidationError } from './types';\n\n/** Converts an `errorSchema` into a list of `RJSFValidationErrors`\n *\n * @param errorSchema - The `ErrorSchema` instance to convert\n * @param [fieldPath=[]] - The current field path, defaults to [] if not specified\n * @returns - The list of `RJSFValidationErrors` extracted from the `errorSchema`\n */\nexport default function toErrorList<T = any>(\n errorSchema?: ErrorSchema<T>,\n fieldPath: string[] = [],\n): RJSFValidationError[] {\n if (!errorSchema) {\n return [];\n }\n let errorList: RJSFValidationError[] = [];\n if (ERRORS_KEY in errorSchema) {\n errorList = errorList.concat(\n errorSchema[ERRORS_KEY]!.map((message: string) => {\n const property = `.${fieldPath.join('.')}`;\n return {\n property,\n message,\n stack: `${property} ${message}`,\n };\n }),\n );\n }\n return Object.keys(errorSchema).reduce((currentList, key) => {\n if (key !== ERRORS_KEY) {\n const childSchema = (errorSchema as GenericObjectType)[key];\n if (isPlainObject(childSchema)) {\n return currentList.concat(toErrorList(childSchema, [...fieldPath, key]));\n }\n }\n return currentList;\n }, errorList);\n}\n", "import arrayMap from './_arrayMap.js';\nimport copyArray from './_copyArray.js';\nimport isArray from './isArray.js';\nimport isSymbol from './isSymbol.js';\nimport stringToPath from './_stringToPath.js';\nimport toKey from './_toKey.js';\nimport toString from './toString.js';\n\n/**\n * Converts `value` to a property path array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {*} value The value to convert.\n * @returns {Array} Returns the new property path array.\n * @example\n *\n * _.toPath('a.b.c');\n * // => ['a', 'b', 'c']\n *\n * _.toPath('a[0].b.c');\n * // => ['a', '0', 'b', 'c']\n */\nfunction toPath(value) {\n if (isArray(value)) {\n return arrayMap(value, toKey);\n }\n return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));\n}\n\nexport default toPath;\n", "import toPath from 'lodash/toPath';\n\nimport ErrorSchemaBuilder from './ErrorSchemaBuilder';\nimport type { ErrorSchema, RJSFValidationError } from './types';\n\n/** Transforms a rjsf validation errors list:\n * [\n * {property: '.level1.level2[2].level3', message: 'err a'},\n * {property: '.level1.level2[2].level3', message: 'err b'},\n * {property: '.level1.level2[4].level3', message: 'err b'},\n * ]\n * Into an error tree:\n * {\n * level1: {\n * level2: {\n * 2: {level3: {errors: ['err a', 'err b']}},\n * 4: {level3: {errors: ['err b']}},\n * }\n * }\n * };\n *\n * @param errors - The list of RJSFValidationError objects\n * @returns - The `ErrorSchema` built from the list of `RJSFValidationErrors`\n */\nexport default function toErrorSchema<T = any>(errors: RJSFValidationError[]): ErrorSchema<T> {\n const builder = new ErrorSchemaBuilder<T>();\n if (errors.length) {\n errors.forEach((error) => {\n const { property, message } = error;\n // When the property is the root element, just use an empty array for the path\n const path = property === '.' ? [] : toPath(property);\n // If the property is at the root (.level1) then toPath creates\n // an empty array element at the first index. Remove it.\n if (path.length > 0 && path[0] === '') {\n path.splice(0, 1);\n }\n if (message) {\n builder.addErrors(message, path);\n }\n });\n }\n return builder.ErrorSchema;\n}\n", "import { ID_KEY } from './constants';\nimport type { FieldPathId, FieldPathList, GlobalFormOptions } from './types';\n\n/** Constructs the `FieldPathId` for `fieldPath`. If `parentPathId` is provided, the `fieldPath` is appended to the end\n * of the parent path. Then the `ID_KEY` of the resulting `FieldPathId` is constructed from the `idPrefix` and\n * `idSeparator` contained within the `globalFormOptions`. If `fieldPath` is passed as an empty string, it will simply\n * generate the path from the `parentPath` (if provided) and the `idPrefix` and `idSeparator`. If a `nameGenerator`\n * is provided in `globalFormOptions`, it will also generate the HTML `name` attribute.\n *\n * @param fieldPath - The property name or array index of the current field element\n * @param globalFormOptions - The `GlobalFormOptions` used to get the `idPrefix` and `idSeparator`\n * @param [parentPath] - The optional `FieldPathId` or `FieldPathList` of the parent element for this field element\n * @param [isMultiValue] - Optional flag indicating this field accepts multiple values\n * @returns - The `FieldPathId` for the given `fieldPath` and the optional `parentPathId`\n */\nexport default function toFieldPathId(\n fieldPath: string | number,\n globalFormOptions: GlobalFormOptions,\n parentPath?: FieldPathId | FieldPathList,\n isMultiValue?: boolean,\n): FieldPathId {\n const basePath = Array.isArray(parentPath) ? parentPath : parentPath?.path;\n const childPath = fieldPath === '' ? [] : [fieldPath];\n const path = basePath ? basePath.concat(...childPath) : childPath;\n const id = [globalFormOptions.idPrefix, ...path].join(globalFormOptions.idSeparator);\n\n // Generate name attribute if nameGenerator is provided\n let name: string | undefined;\n if (globalFormOptions.nameGenerator && path.length > 0) {\n name = globalFormOptions.nameGenerator(path, globalFormOptions.idPrefix, isMultiValue);\n }\n\n return { path, [ID_KEY]: id, ...(name !== undefined && { name }) };\n}\n", "import isPlainObject from 'lodash/isPlainObject';\n\nimport type { ErrorSchema, FormValidation, GenericObjectType } from './types';\n\n/** Unwraps the `errorHandler` structure into the associated `ErrorSchema`, stripping the `addError()` functions from it\n *\n * @param errorHandler - The `FormValidation` error handling structure\n * @returns - The `ErrorSchema` resulting from the stripping of the `addError()` function\n */\nexport default function unwrapErrorHandler<T = any>(errorHandler: FormValidation<T>): ErrorSchema<T> {\n return Object.keys(errorHandler).reduce<ErrorSchema<T>>((acc, key) => {\n if (key === 'addError') {\n return acc;\n }\n const childSchema = (errorHandler as GenericObjectType)[key];\n if (isPlainObject(childSchema)) {\n return {\n ...acc,\n [key]: unwrapErrorHandler(childSchema),\n };\n }\n return { ...acc, [key]: childSchema };\n }, {});\n}\n", "'use client';\n\nimport type { MouseEvent } from 'react';\nimport { useCallback, useEffect, useMemo, useState } from 'react';\n\nimport dateRangeOptions from './dateRangeOptions';\nimport type { DateElementFormat, DateElementProp } from './getDateElementProps';\nimport getDateElementProps from './getDateElementProps';\nimport { ariaDescribedByIds } from './idGenerators';\nimport parseDateString from './parseDateString';\nimport toDateString from './toDateString';\nimport type { DateObject, FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from './types';\n\n/** Function that checks to see if a `DateObject` is ready for the onChange callback to be triggered\n *\n * @param state - The current `DateObject`\n * @returns - True if the `state` is ready to trigger an onChange\n */\nfunction readyForChange(state: DateObject) {\n return Object.values(state).every((value) => value !== -1);\n}\n\n/** The Props for the `DateElement` component */\nexport type DateElementProps<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any> = Pick<\n WidgetProps<T, S, F>,\n 'value' | 'name' | 'disabled' | 'readonly' | 'autofocus' | 'registry' | 'onBlur' | 'onFocus' | 'className'\n> & {\n /** The root id of the field */\n rootId: string;\n /** The selector function for a specific prop within the `DateObject`, for a value */\n select: (property: keyof DateObject, value: any) => void;\n /** The type of the date element */\n type: DateElementProp['type'];\n /** The range for the date element */\n range: DateElementProp['range'];\n};\n\n/** The `DateElement` component renders one of the 6 date element selectors for an `AltDateWidget`, using the `select`\n * widget from the registry.\n *\n * @param props - The `DateElementProps` for the date element\n */\nexport function DateElement<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(\n props: DateElementProps<T, S, F>,\n) {\n const {\n className = 'form-control',\n type,\n range,\n value,\n select,\n rootId,\n name,\n disabled,\n readonly,\n autofocus,\n registry,\n onBlur,\n onFocus,\n } = props;\n const id = `${rootId}_${type}`;\n const { SelectWidget } = registry.widgets;\n const onChange = useCallback((newValue: any) => select(type as keyof DateObject, newValue), [select, type]);\n return (\n <SelectWidget\n schema={{ type: 'integer' } as S}\n id={id}\n name={name}\n className={className}\n options={{ enumOptions: dateRangeOptions<S>(range[0], range[1]) }}\n placeholder={type}\n value={value}\n disabled={disabled}\n readonly={readonly}\n autofocus={autofocus}\n onChange={onChange}\n onBlur={onBlur}\n onFocus={onFocus}\n registry={registry}\n label=''\n aria-describedby={ariaDescribedByIds(rootId)}\n />\n );\n}\n\n/** The result of a call to the `useAltDateWidgetProps()` hook */\nexport interface UseAltDateWidgetResult {\n /** The list of `DateElementProp` data to render for the `AltDateWidget` */\n elements: DateElementProp[];\n /** The callback that handles the changing of DateElement components */\n handleChange: (property: keyof DateObject, value?: string) => void;\n /** The callback that will clear the `AltDateWidget` when a button is clicked */\n handleClear: (event: MouseEvent) => void;\n /** The callback that will set the `AltDateWidget` to NOW when a button is clicked */\n handleSetNow: (event: MouseEvent) => void;\n}\n\n/** Hook which encapsulates the logic needed to render an `AltDateWidget` with optional `time` elements. It contains\n * the `state` of the current date(/time) selections in the widget. It returns a `UseAltDateWidgetResult` object\n * that contains the `elements: DateElementProp[]` and three callbacks needed to change one of the rendered `elements`,\n * and to handle the clicking of the `clear` and `setNow` buttons.\n *\n * @param props - The `WidgetProps` for the `AltDateWidget`\n */\nexport default function useAltDateWidgetProps<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(props: WidgetProps<T, S, F>): UseAltDateWidgetResult {\n const { time = false, disabled = false, readonly = false, options, onChange, value } = props;\n const [state, setState] = useState(parseDateString(value, time));\n\n useEffect(() => {\n setState(parseDateString(value, time));\n }, [time, value]);\n\n const handleChange = useCallback(\n (property: keyof DateObject, newValue?: string) => {\n const nextState = {\n ...state,\n [property]: typeof newValue === 'undefined' ? -1 : newValue,\n };\n\n if (readyForChange(nextState)) {\n onChange(toDateString(nextState, time));\n } else {\n setState(nextState);\n }\n },\n [state, onChange, time],\n );\n\n const handleClear = useCallback(\n (event: MouseEvent) => {\n event.preventDefault();\n if (disabled || readonly) {\n return;\n }\n onChange(undefined);\n },\n [disabled, readonly, onChange],\n );\n\n const handleSetNow = useCallback(\n (event: MouseEvent) => {\n event.preventDefault();\n if (disabled || readonly) {\n return;\n }\n const nextState = parseDateString(new Date().toJSON(), time);\n onChange(toDateString(nextState, time));\n },\n [disabled, readonly, time, onChange],\n );\n\n const elements = useMemo(\n () =>\n getDateElementProps(\n state,\n time,\n options.yearsRange as [number, number] | undefined,\n options.format as DateElementFormat | undefined,\n ),\n [state, time, options.yearsRange, options.format],\n );\n return { elements, handleChange, handleClear, handleSetNow };\n}\n", "'use client';\n\nimport { useRef } from 'react';\n\nimport deepEquals from './deepEquals';\n\n/** Hook that stores and returns a `T` value. If `newValue` is the same as the stored one, then the stored one is\n * returned to avoid having a component rerender due it being a different object. Otherwise, the `newValue` is stored\n * and returned.\n *\n * @param newValue - The potential new `T` value\n * @returns - The latest stored `T` value\n */\nexport default function useDeepCompareMemo<T = unknown>(newValue: T): T {\n const valueRef = useRef<T>(newValue);\n if (!deepEquals(newValue, valueRef.current)) {\n valueRef.current = newValue;\n }\n return valueRef.current;\n}\n", "'use client';\n\nimport { useCallback, useMemo } from 'react';\n\nimport dataURItoBlob from './dataURItoBlob';\n\n/** The information about files used by a FileWidget */\nexport interface FileInfoType {\n /** The url of the data containing the file */\n dataURL?: string | null;\n /** The name of the file */\n name: string;\n /** The size of the file */\n size: number;\n /** The type of the file */\n type: string;\n}\n\nexport interface UseFileWidgetPropsResult {\n /** The list of FileInfoType contained within the FileWidget */\n filesInfo: FileInfoType[];\n /** The callback handler to pass to the onChange of the input */\n handleChange: (files: FileList) => void | Promise<void>;\n /** The callback handler to pass in order to delete a file */\n handleRemove: (index: number) => void;\n}\n\n/** Updated the given `dataUrl` to add the `name` to it\n *\n * @param dataURL - The url description string\n * @param name - The name of the file to add to the dataUrl\n * @returns - The `dataUrl` updated to include the name\n */\nfunction addNameToDataURL(dataURL: string, name: string) {\n return dataURL.replace(';base64', `;name=${encodeURIComponent(name)};base64`);\n}\n\n/** Returns a promise that will read the file from the browser and return it as the result of the promise.\n *\n * @param file - The `File` information to read\n * @returns - A promise that resolves to the read file.\n */\nasync function processFile(file: File): Promise<FileInfoType> {\n const { name, size, type } = file;\n return new Promise((resolve, reject) => {\n const reader = new window.FileReader();\n reader.onerror = reject;\n reader.onload = (event) => {\n if (typeof event.target?.result === 'string') {\n resolve({\n dataURL: addNameToDataURL(event.target.result, name),\n name,\n size,\n type,\n });\n } else {\n resolve({\n dataURL: null,\n name,\n size,\n type,\n });\n }\n };\n reader.readAsDataURL(file);\n });\n}\n\n/** Reads a list of files from the browser, returning the results of the promises of each individual file read.\n *\n * @param files - The list of files to read\n * @returns - The list of read files\n */\nasync function processFiles(files: FileList) {\n return Promise.all(Array.from(files).map(processFile));\n}\n\n/** Extracts the file information from the data URLs\n *\n * @param dataURLs - The information about the files\n * @returns - The list of `FileInfoType` objects extracted from the data urls\n */\nfunction extractFileInfo(dataURLs: string[]): FileInfoType[] {\n return dataURLs.reduce<FileInfoType[]>((acc, dataURL) => {\n if (!dataURL) {\n return acc;\n }\n try {\n const { blob, name } = dataURItoBlob(dataURL);\n return [\n ...acc,\n {\n dataURL,\n name,\n size: blob.size,\n type: blob.type,\n },\n ];\n } catch {\n // Invalid dataURI, so just ignore it.\n return acc;\n }\n }, []);\n}\n\n/** Hook which encapsulates the logic needed to read and convert a `value` of `File` or `File[]` into the\n * `filesInfo: FileInfoType[]` and the two callback implementations needed to change the list or to remove a\n * `File` from the list. To be used by theme specific `FileWidget` implementations.\n *\n * @param value - The current value of the `FileWidget`\n * @param onChange - The onChange handler for the `FileWidget`\n * @param [multiple=false] - Flag indicating whether the control supports multiple selections\n * @returns - The `UseFileWidgetPropsResult` to be used within a `FileWidget` implementation\n */\nexport default function useFileWidgetProps(\n value: string | string[] | undefined | null,\n onChange: (value?: string | null | (string | null)[]) => void,\n multiple = false,\n): UseFileWidgetPropsResult {\n const values: (string | null)[] = useMemo(() => {\n if (multiple && value) {\n return Array.isArray(value) ? value : [value];\n }\n return [];\n }, [value, multiple]);\n const filesInfo = useMemo(\n () => (Array.isArray(value) ? extractFileInfo(value) : extractFileInfo([value || ''])),\n [value],\n );\n\n const handleChange = useCallback(\n async (files: FileList) => {\n const filesInfoEvent = await processFiles(files);\n const newValue = filesInfoEvent.map((fileInfo) => fileInfo.dataURL || null);\n if (multiple) {\n onChange(values.concat(...newValue));\n } else {\n onChange(newValue[0]);\n }\n },\n [values, multiple, onChange],\n );\n const handleRemove = useCallback(\n (index: number) => {\n if (multiple) {\n const newValue = values.filter((_, i: number) => i !== index);\n onChange(newValue);\n } else {\n onChange(undefined);\n }\n },\n [values, multiple, onChange],\n );\n\n return { filesInfo, handleChange, handleRemove };\n}\n", "import pad from './pad';\n\n/** Converts a UTC date string into a local Date format\n *\n * @param jsonDate - A UTC date string\n * @returns - An empty string when `jsonDate` is falsey, otherwise a date string in local format\n */\nexport default function utcToLocal(jsonDate: string) {\n if (!jsonDate) {\n return '';\n }\n\n // required format of `'yyyy-MM-ddThh:mm' followed by optional ':ss' or ':ss.SSS'\n // https://html.spec.whatwg.org/multipage/input.html#local-date-and-time-state-(type%3Ddatetime-local)\n // > should be a _valid local date and time string_ (not GMT)\n\n // Note - date constructor passed local ISO-8601 does not correctly\n // change time to UTC in node pre-8\n const date = new Date(jsonDate);\n\n const yyyy = pad(date.getFullYear(), 4);\n const MM = pad(date.getMonth() + 1, 2);\n const dd = pad(date.getDate(), 2);\n const hh = pad(date.getHours(), 2);\n const mm = pad(date.getMinutes(), 2);\n const ss = pad(date.getSeconds(), 2);\n const SSS = pad(date.getMilliseconds(), 3);\n\n return `${yyyy}-${MM}-${dd}T${hh}:${mm}:${ss}.${SSS}`;\n}\n", "import isEmpty from 'lodash/isEmpty';\n\nimport mergeObjects from './mergeObjects';\nimport toErrorList from './toErrorList';\nimport type { ErrorSchema, ValidationData } from './types';\n\n/** Merges the errors in `additionalErrorSchema` into the existing `validationData` by combining the hierarchies in the\n * two `ErrorSchema`s and then appending the error list from the `additionalErrorSchema` obtained by calling\n * `toErrorList()` on the `errors` in the `validationData`. If no `additionalErrorSchema` is passed, then\n * `validationData` is returned.\n *\n * @param validationData - The current `ValidationData` into which to merge the additional errors\n * @param [additionalErrorSchema] - The optional additional set of errors in an `ErrorSchema`\n * @param [preventDuplicates=false] - Optional flag, if true, will call `mergeObjects()` with `preventDuplicates`\n * @returns - The `validationData` with the additional errors from `additionalErrorSchema` merged into it, if provided.\n */\nexport default function validationDataMerge<T = any>(\n validationData: ValidationData<T>,\n additionalErrorSchema?: ErrorSchema<T>,\n preventDuplicates = false,\n): ValidationData<T> {\n if (!additionalErrorSchema) {\n return validationData;\n }\n const { errors: oldErrors, errorSchema: oldErrorSchema } = validationData;\n let errors = toErrorList(additionalErrorSchema);\n let errorSchema = additionalErrorSchema;\n if (!isEmpty(oldErrorSchema)) {\n errorSchema = mergeObjects(\n oldErrorSchema,\n additionalErrorSchema,\n preventDuplicates ? 'preventDuplicates' : true,\n ) as ErrorSchema<T>;\n errors = [...oldErrors].concat(errors);\n }\n return { errorSchema, errors };\n}\n", "import isObject from 'lodash/isObject';\n\nimport { REF_KEY, ROOT_SCHEMA_PREFIX } from './constants';\nimport type { RJSFSchema, StrictRJSFSchema } from './types';\n\n/** Takes a `node` object and transforms any contained `$ref` node variables with a prefix, recursively calling\n * `withIdRefPrefix` for any other elements.\n *\n * @param node - The object node to which a ROOT_SCHEMA_PREFIX is added when a REF_KEY is part of it\n */\nfunction withIdRefPrefixObject<S extends StrictRJSFSchema = RJSFSchema>(node: S): S {\n const realObj: Record<string, any> = node;\n for (const key in realObj) {\n /* v8 ignore next -- spread in caller guarantees only own properties reach this loop */\n if (Object.hasOwn(realObj, key)) {\n const value = realObj[key];\n if (key === REF_KEY && typeof value === 'string' && value.startsWith('#')) {\n realObj[key] = ROOT_SCHEMA_PREFIX + value;\n } else {\n realObj[key] = withIdRefPrefix<S>(value);\n }\n }\n }\n return node;\n}\n\n/** Takes a `node` object list and transforms any contained `$ref` node variables with a prefix, recursively calling\n * `withIdRefPrefix` for any other elements.\n *\n * @param node - The list of object nodes to which a ROOT_SCHEMA_PREFIX is added when a REF_KEY is part of it\n */\nfunction withIdRefPrefixArray<S extends StrictRJSFSchema = RJSFSchema>(node: S[]): S[] {\n return node.map((item) => withIdRefPrefix<S>(item) as S);\n}\n\n/** Recursively prefixes all `$ref`s in a schema with the value of the `ROOT_SCHEMA_PREFIX` constant.\n * This is used in isValid to make references to the rootSchema\n *\n * @param schemaNode - The object node to which a ROOT_SCHEMA_PREFIX is added when a REF_KEY is part of it\n * @returns - A copy of the `schemaNode` with updated `$ref`s\n */\nexport default function withIdRefPrefix<S extends StrictRJSFSchema = RJSFSchema>(\n schemaNode: S | S[] | S[keyof S],\n): S | S[] | S[keyof S] {\n if (Array.isArray(schemaNode)) {\n return withIdRefPrefixArray<S>([...schemaNode]);\n }\n if (isObject(schemaNode)) {\n return withIdRefPrefixObject<S>({ ...schemaNode });\n }\n return schemaNode;\n}\n", "/** An enumeration of all the translatable strings used by `@rjsf/core` and its themes. The value of each of the\n * enumeration keys is expected to be the actual english string. Some strings contain replaceable parameter values\n * as indicated by `%1`, `%2`, etc. The number after the `%` indicates the order of the parameter. The ordering of\n * parameters is important because some languages may choose to put the second parameter before the first in its\n * translation. Also, some strings are rendered using `markdown-to-jsx` and thus support markdown and inline html.\n */\nexport enum TranslatableString {\n /** Fallback title of an array item, used by ArrayField */\n ArrayItemTitle = 'Item',\n /** Missing items reason, used by ArrayField */\n MissingItems = 'Missing items definition',\n /** Empty array message, used by ArrayField */\n EmptyArray = 'No items yet. Use the button below to add some.',\n /** Yes label, used by BooleanField */\n YesLabel = 'Yes',\n /** No label, used by BooleanField */\n NoLabel = 'No',\n /** Close label, used by ErrorList */\n CloseLabel = 'Close',\n /** Errors label, used by ErrorList */\n ErrorsLabel = 'Errors',\n /** New additionalProperties string default value, used by ObjectField */\n NewStringDefault = 'New Value',\n /** Add button title, used by AddButton */\n AddButton = 'Add',\n /** Add button title, used by AddButton */\n AddItemButton = 'Add Item',\n /** Copy button title, used by IconButton */\n CopyButton = 'Copy',\n /** Expand cycle button title */\n ExpandButton = 'Expand Cycle',\n /** Move down button title, used by IconButton */\n MoveDownButton = 'Move down',\n /** Move up button title, used by IconButton */\n MoveUpButton = 'Move up',\n /** Remove button title, used by IconButton */\n RemoveButton = 'Remove',\n /** Now label, used by AltDateWidget */\n NowLabel = 'Now',\n /** Clear label, used by AltDateWidget */\n ClearLabel = 'Clear',\n /** Aria date label, used by DateWidget */\n AriaDateLabel = 'Select a date',\n /** File preview label, used by FileWidget */\n PreviewLabel = 'Preview',\n /** Decrement button aria label, used by UpDownWidget */\n DecrementAriaLabel = 'Decrease value by 1',\n /** Increment button aria label, used by UpDownWidget */\n IncrementAriaLabel = 'Increase value by 1',\n /** The label for the Add button in for an optional object field */\n OptionalObjectAdd = 'Add data for optional field',\n /** The label for the Remove button in for an optional object field */\n OptionalObjectRemove = 'Remove data for optional field',\n /** The label for when displaying a non-editable form with missing optional field data */\n OptionalObjectEmptyMsg = 'No data for optional field',\n /** Label for the schema type selector, used by FallbackField */\n Type = 'Type',\n /** Label for the 'value' field, used by FallbackField */\n Value = 'Value',\n /** Clear button title, used by IconButton */\n ClearButton = 'clear input',\n // Strings with replaceable parameters\n /** Unknown field type reason, where %1 will be replaced with the type as provided by SchemaField */\n UnknownFieldType = 'Unknown field type %1',\n /** Option prefix, where %1 will be replaced with the option index as provided by MultiSchemaField */\n OptionPrefix = 'Option %1',\n /** Option prefix, where %1 and %2 will be replaced by the schema title and option index, respectively as provided by\n * MultiSchemaField\n */\n TitleOptionPrefix = '%1 option %2',\n /** Key label, where %1 will be replaced by the label as provided by WrapIfAdditionalTemplate */\n KeyLabel = '%1 Key',\n /** Deprecated label, where %1 will be replaced by the label as provided by SchemaField */\n DeprecatedLabel = '%1 (deprecated)',\n /** Cyclic schema message */\n CycleDetected = 'Circular reference ($ref cycle) detected for field \"%1\". You may choose to expand to the next cycle break',\n // Strings with replaceable parameters AND/OR that support markdown and html\n /** Invalid object field configuration as provided by the ObjectField.\n * NOTE: Use markdown notation rather than html tags.\n */\n InvalidObjectField = 'Invalid \"%1\" object field configuration: _%2_.',\n /** Unsupported field schema, used by UnsupportedField */\n UnsupportedField = 'Unsupported field schema.',\n /** Unsupported field schema, where %1 will be replaced by the FieldPathId.$id as provided by UnsupportedField.\n * NOTE: Use markdown notation rather than html tags.\n */\n UnsupportedFieldWithId = 'Unsupported field schema for field `%1`.',\n /** Unsupported field schema, where %1 will be replaced by the reason string as provided by UnsupportedField.\n * NOTE: Use markdown notation rather than html tags.\n */\n UnsupportedFieldWithReason = 'Unsupported field schema: _%1_.',\n /** Unsupported field schema, where %1 and %2 will be replaced by the FieldPathId.$id and reason strings,\n * respectively, as provided by UnsupportedField.\n * NOTE: Use markdown notation rather than html tags.\n */\n UnsupportedFieldWithIdAndReason = 'Unsupported field schema for field `%1`: _%2_.',\n /** File name, type and size info, where %1, %2 and %3 will be replaced by the file name, file type and file size as\n * provided by FileWidget\n */\n FilesInfo = '**%1** (%2, %3 bytes)',\n}\n", "import arrayEach from './_arrayEach.js';\nimport baseEach from './_baseEach.js';\nimport castFunction from './_castFunction.js';\nimport isArray from './isArray.js';\n\n/**\n * Iterates over elements of `collection` and invokes `iteratee` for each element.\n * The iteratee is invoked with three arguments: (value, index|key, collection).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\"\n * property are iterated like arrays. To avoid this behavior use `_.forIn`\n * or `_.forOwn` for object iteration.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias each\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEachRight\n * @example\n *\n * _.forEach([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `1` then `2`.\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\nfunction forEach(collection, iteratee) {\n var func = isArray(collection) ? arrayEach : baseEach;\n return func(collection, castFunction(iteratee));\n}\n\nexport default forEach;\n", "import type {\n CustomValidator,\n ErrorTransformer,\n FormContextType,\n RJSFSchema,\n RJSFValidationError,\n StrictRJSFSchema,\n UiSchema,\n ValidatorType,\n} from '@rjsf/utils';\nimport {\n ANY_OF_KEY,\n createErrorHandler,\n getDefaultFormState,\n getUiOptions,\n ONE_OF_KEY,\n PROPERTIES_KEY,\n toErrorSchema,\n unwrapErrorHandler,\n validationDataMerge,\n} from '@rjsf/utils';\nimport type { ErrorObject } from 'ajv';\nimport get from 'lodash/get';\n\nimport type { SuppressDuplicateFilteringType } from './types';\n\nexport interface RawValidationErrorsType<Result = any> {\n errors?: Result[];\n validationError?: Error;\n}\n\n/** Filters duplicate errors from `anyOf`/`oneOf` schema paths according to the `suppressDuplicateFiltering` flag.\n *\n * @param errorList - The list of `RJSFValidationError`s to filter\n * @param [suppressDuplicateFiltering='none'] - Controls which duplicate filtering is suppressed:\n * - `'none'` (default): filters duplicates for both `anyOf` and `oneOf`\n * - `'all'`: returns `errorList` unmodified\n * - `'anyOf'`: suppresses filtering for `anyOf` errors; `oneOf` duplicates are still filtered\n * - `'oneOf'`: suppresses filtering for `oneOf` errors; `anyOf` duplicates are still filtered\n */\nexport function filterDuplicateErrors(\n errorList: RJSFValidationError[],\n suppressDuplicateFiltering: SuppressDuplicateFilteringType = 'none',\n): RJSFValidationError[] {\n if (suppressDuplicateFiltering === 'all') {\n return errorList;\n }\n return errorList.reduce<RJSFValidationError[]>((acc: RJSFValidationError[], err: RJSFValidationError) => {\n const { message, schemaPath } = err;\n // Compute the index only when filtering for that keyword is not suppressed.\n // 'all' is already handled above; within the reduce, only 'none', 'anyOf', and 'oneOf' are possible.\n const anyOfIndex = suppressDuplicateFiltering !== 'anyOf' ? schemaPath?.indexOf(`/${ANY_OF_KEY}/`) : undefined;\n const oneOfIndex = suppressDuplicateFiltering !== 'oneOf' ? schemaPath?.indexOf(`/${ONE_OF_KEY}/`) : undefined;\n let schemaPrefix: string | undefined;\n if (anyOfIndex && anyOfIndex >= 0) {\n schemaPrefix = schemaPath?.substring(0, anyOfIndex);\n } else if (oneOfIndex && oneOfIndex >= 0) {\n schemaPrefix = schemaPath?.substring(0, oneOfIndex);\n }\n // If there is a schemaPrefix, then search for a duplicate message with the same prefix, otherwise undefined\n const dup = schemaPrefix\n ? acc.find((e: RJSFValidationError) => e.message === message && e.schemaPath?.startsWith(schemaPrefix))\n : undefined;\n if (!dup) {\n acc.push(err);\n }\n return acc;\n }, []);\n}\n\n/** Transforming the error output from ajv to format used by @rjsf/utils.\n * At some point, components should be updated to support ajv.\n *\n * @param errors - The list of AJV errors to convert to `RJSFValidationErrors`\n * @param [uiSchema] - An optional uiSchema that is passed to `transformErrors` and `customValidate`\n * @param [suppressDuplicateFiltering] - Controls which duplicate filtering is suppressed; see `filterDuplicateErrors`\n * @param [schema] - The schema for the validation\n */\nexport function transformRJSFValidationErrors<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n errors: ErrorObject[] = [],\n uiSchema?: UiSchema<T, S, F>,\n suppressDuplicateFiltering?: SuppressDuplicateFilteringType,\n schema?: S,\n): RJSFValidationError[] {\n const errorList = errors.map((e: ErrorObject) => {\n const { instancePath, keyword, params, schemaPath, parentSchema, ...rest } = e;\n let { message = '' } = rest;\n let property = instancePath.replace(/\\//g, '.');\n let stack = `${property} ${message}`.trim();\n let uiTitle = '';\n const rawPropertyNames: string[] = [\n ...(params.deps?.split(', ') || []),\n params.missingProperty,\n params.property,\n ].filter((item) => item);\n\n if (rawPropertyNames.length > 0) {\n rawPropertyNames.forEach((currentProperty) => {\n const path = property ? `${property}.${currentProperty}` : currentProperty;\n let uiSchemaTitle = getUiOptions(get(uiSchema, path.replace(/^\\./, ''))).title;\n if (uiSchemaTitle === undefined) {\n // To retrieve a title from UI schema, construct a path to UI schema from `schemaPath` and `currentProperty`.\n // For example, when `#/properties/A/properties/B/required` and `C` are given, they are converted into `['A', 'B', 'C']`.\n const uiSchemaPath = schemaPath\n .replace(/\\/properties\\//g, '/')\n .split('/')\n .slice(1, -1)\n .concat([currentProperty]);\n uiSchemaTitle = getUiOptions(get(uiSchema, uiSchemaPath)).title;\n }\n if (uiSchemaTitle === undefined) {\n // schemaPath may include non-property segments (e.g. allOf/if/then) that do\n // not exist in the uiSchema; fall back to the instance path, the same way the\n // root-schema title fallback does below.\n const propParts = property.replace(/^\\./, '').split('.').filter(Boolean);\n uiSchemaTitle = get(uiSchema, [...propParts, currentProperty, 'title']) as string | undefined;\n }\n if (uiSchemaTitle) {\n message = message.replace(`'${currentProperty}'`, `'${uiSchemaTitle}'`);\n uiTitle = uiSchemaTitle;\n } else {\n const parentSchemaTitle = get(parentSchema, [PROPERTIES_KEY, currentProperty, 'title']);\n if (parentSchemaTitle) {\n message = message.replace(`'${currentProperty}'`, `'${parentSchemaTitle}'`);\n uiTitle = parentSchemaTitle;\n } else if (schema) {\n // parentSchema may be an allOf/anyOf/oneOf entry that lacks `properties`;\n // fall back to looking up the title from the root schema.\n const propParts = property.replace(/^\\./, '').split('.').filter(Boolean);\n const aSchemaPath: (string | number)[] = [];\n for (const part of propParts) {\n aSchemaPath.push(PROPERTIES_KEY, part);\n }\n aSchemaPath.push(PROPERTIES_KEY, currentProperty, 'title');\n const rootSchemaTitle = get(schema, aSchemaPath) as string | undefined;\n if (rootSchemaTitle) {\n message = message.replace(`'${currentProperty}'`, `'${rootSchemaTitle}'`);\n uiTitle = rootSchemaTitle;\n }\n }\n }\n });\n\n stack = message;\n } else {\n const uiSchemaTitle = getUiOptions<T, S, F>(get(uiSchema, property.replace(/^\\./, ''))).title;\n\n if (uiSchemaTitle) {\n stack = `'${uiSchemaTitle}' ${message}`.trim();\n uiTitle = uiSchemaTitle;\n } else {\n const parentSchemaTitle = parentSchema?.title;\n\n if (parentSchemaTitle) {\n stack = `'${parentSchemaTitle}' ${message}`.trim();\n uiTitle = parentSchemaTitle;\n }\n }\n }\n\n // If params.missingProperty is undefined, it is removed from rawPropertyNames by filter((item) => item).\n if ('missingProperty' in params) {\n property = property ? `${property}.${params.missingProperty}` : params.missingProperty;\n }\n\n // put data in expected format\n return {\n name: keyword,\n property,\n message,\n params, // specific to ajv\n stack,\n schemaPath,\n title: uiTitle,\n };\n });\n return filterDuplicateErrors(errorList, suppressDuplicateFiltering);\n}\n\n/** This function processes the `formData` with an optional user contributed `customValidate` function, which receives\n * the form data and a `errorHandler` function that will be used to add custom validation errors for each field. Also\n * supports a `transformErrors` function that will take the raw AJV validation errors, prior to custom validation and\n * transform them in what ever way it chooses.\n *\n * @param validator - The `ValidatorType` implementation used for the `getDefaultFormState()` call\n * @param rawErrors - The list of raw `ErrorObject`s to process\n * @param formData - The form data to validate\n * @param schema - The schema against which to validate the form data\n * @param [customValidate] - An optional function that is used to perform custom validation\n * @param [transformErrors] - An optional function that is used to transform errors after AJV validation\n * @param [uiSchema] - An optional uiSchema that is passed to `transformErrors` and `customValidate`\n * @param [suppressDuplicateFiltering] - Controls which duplicate filtering is suppressed; see `filterDuplicateErrors`\n */\nexport default function processRawValidationErrors<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n validator: ValidatorType<T, S, F>,\n rawErrors: RawValidationErrorsType<ErrorObject>,\n formData: T | undefined,\n schema: S,\n customValidate?: CustomValidator<T, S, F>,\n transformErrors?: ErrorTransformer<T, S, F>,\n uiSchema?: UiSchema<T, S, F>,\n suppressDuplicateFiltering?: SuppressDuplicateFilteringType,\n) {\n const { validationError: invalidSchemaError } = rawErrors;\n let errors = transformRJSFValidationErrors<T, S, F>(rawErrors.errors, uiSchema, suppressDuplicateFiltering, schema);\n\n if (invalidSchemaError) {\n errors = [...errors, { stack: invalidSchemaError.message }];\n }\n if (typeof transformErrors === 'function') {\n errors = transformErrors(errors, uiSchema);\n }\n\n let errorSchema = toErrorSchema<T>(errors);\n\n if (invalidSchemaError) {\n errorSchema = {\n ...errorSchema,\n $schema: {\n __errors: [invalidSchemaError.message],\n },\n };\n }\n\n if (typeof customValidate !== 'function') {\n return { errors, errorSchema };\n }\n\n // Include form data with undefined values, which is required for custom validation.\n const newFormData = getDefaultFormState<T, S, F>(validator, schema, formData, schema, true) as T;\n\n const errorHandler = customValidate(newFormData, createErrorHandler<T>(newFormData), uiSchema, errorSchema);\n const userErrorSchema = unwrapErrorHandler<T>(errorHandler);\n return validationDataMerge<T>({ errors, errorSchema }, userErrorSchema);\n}\n", "import type {\n CustomValidator,\n ErrorTransformer,\n FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n UiSchema,\n ValidationData,\n ValidatorType,\n} from '@rjsf/utils';\nimport { deepEquals, hashForSchema, ID_KEY, JUNK_OPTION_ID, retrieveSchema } from '@rjsf/utils';\nimport type { ErrorObject } from 'ajv';\nimport get from 'lodash/get';\n\nimport type { RawValidationErrorsType } from './processRawValidationErrors';\nimport processRawValidationErrors from './processRawValidationErrors';\nimport type { CompiledValidateFunction, Localizer, SuppressDuplicateFilteringType, ValidatorFunctions } from './types';\n\n/** `ValidatorType` implementation that uses an AJV 8 precompiled validator as created by the\n * `compileSchemaValidators()` function provided by the `@rjsf/validator-ajv8` library.\n */\nexport default class AJV8PrecompiledValidator<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n> implements ValidatorType<T, S, F> {\n /** The root schema object used to construct this validator\n *\n * @private\n */\n readonly rootSchema: S;\n\n /** The `ValidatorFunctions` map used to construct this validator\n *\n * @private\n */\n readonly validateFns: ValidatorFunctions;\n\n /** The main validator function associated with the base schema in the `precompiledValidator`\n *\n * @private\n */\n readonly mainValidator: CompiledValidateFunction;\n\n /** The Localizer function to use for localizing Ajv errors\n *\n * @private\n */\n readonly localizer?: Localizer;\n\n /** Controls which duplicate error filtering is suppressed; see `filterDuplicateErrors`\n *\n * @private\n */\n readonly suppressDuplicateFiltering?: SuppressDuplicateFilteringType;\n\n /** Constructs an `AJV8PrecompiledValidator` instance using the `validateFns` and `rootSchema`\n *\n * @param validateFns - The map of the validation functions that are generated by the `schemaCompile()` function\n * @param rootSchema - The root schema that was used with the `compileSchema()` function\n * @param [localizer] - If provided, is used to localize a list of Ajv `ErrorObject`s\n * @param [suppressDuplicateFiltering] - Controls which duplicate filtering is suppressed; see `filterDuplicateErrors`\n * @throws - Error when the base schema of the precompiled validator does not have a matching validator function\n */\n constructor(\n validateFns: ValidatorFunctions,\n rootSchema: S,\n localizer?: Localizer,\n suppressDuplicateFiltering?: SuppressDuplicateFilteringType,\n ) {\n this.rootSchema = rootSchema;\n this.validateFns = validateFns;\n this.localizer = localizer;\n this.suppressDuplicateFiltering = suppressDuplicateFiltering;\n this.mainValidator = this.getValidator(rootSchema);\n }\n\n /** Returns the precompiled validator associated with the given `schema` from the map of precompiled validator\n * functions.\n *\n * @param schema - The schema for which a precompiled validator function is desired\n * @returns - The precompiled validator function associated with this schema\n */\n getValidator(schema: S) {\n const key = get(schema, ID_KEY) || hashForSchema(schema);\n const validator = this.validateFns[key];\n if (!validator) {\n throw new Error(`No precompiled validator function was found for the given schema for \"${key}\"`);\n }\n return validator;\n }\n\n /** Ensures that the validator is using the same schema as the root schema used to construct the precompiled\n * validator. It first compares the given `schema` against the root schema and if they aren't the same, then it\n * checks against the resolved root schema, on the chance that a resolved version of the root schema was passed in\n * instead of the raw root schema.\n *\n * @param schema - The schema against which to validate the form data\n * @param [formData] - The form data to validate if any\n */\n ensureSameRootSchema(schema: S, formData?: T) {\n if (!deepEquals(schema, this.rootSchema)) {\n // Resolve the root schema with the passed in form data since that may affect the resolution\n const resolvedRootSchema = retrieveSchema(this, this.rootSchema, this.rootSchema, formData);\n if (!deepEquals(schema, resolvedRootSchema)) {\n throw new Error(\n 'The schema associated with the precompiled validator differs from the rootSchema provided for validation',\n );\n }\n }\n return true;\n }\n\n /** Runs the pure validation of the `schema` and `formData` without any of the RJSF functionality. Provided for use\n * by the playground. Returns the `errors` from the validation\n *\n * @param schema - The schema against which to validate the form data\n * @param [formData] - The form data to validate, if any\n * @throws - Error when the schema provided does not match the base schema of the precompiled validator\n */\n rawValidation<Result = any>(schema: S, formData?: T): RawValidationErrorsType<Result> {\n this.ensureSameRootSchema(schema, formData);\n this.mainValidator(formData);\n\n if (typeof this.localizer === 'function') {\n this.localizer(this.mainValidator.errors);\n }\n const errors = this.mainValidator.errors || undefined;\n\n // Clear errors to prevent persistent errors, see #1104\n this.mainValidator.errors = null;\n\n return { errors: errors as unknown as Result[] };\n }\n\n /** This function processes the `formData` with an optional user contributed `customValidate` function, which receives\n * the form data and a `errorHandler` function that will be used to add custom validation errors for each field. Also\n * supports a `transformErrors` function that will take the raw AJV validation errors, prior to custom validation and\n * transform them in what ever way it chooses.\n *\n * @param formData - The form data to validate\n * @param schema - The schema against which to validate the form data\n * @param [customValidate] - An optional function that is used to perform custom validation\n * @param [transformErrors] - An optional function that is used to transform errors after AJV validation\n * @param [uiSchema] - An optional uiSchema that is passed to `transformErrors` and `customValidate`\n */\n validateFormData(\n formData: T | undefined,\n schema: S,\n customValidate?: CustomValidator<T, S, F>,\n transformErrors?: ErrorTransformer<T, S, F>,\n uiSchema?: UiSchema<T, S, F>,\n ): ValidationData<T> {\n const rawErrors = this.rawValidation<ErrorObject>(schema, formData);\n return processRawValidationErrors(\n this,\n rawErrors,\n formData,\n schema,\n customValidate,\n transformErrors,\n uiSchema,\n this.suppressDuplicateFiltering,\n );\n }\n\n /** Validates data against a schema, returning true if the data is valid, or false otherwise. If the schema is\n * invalid, then this function will return false.\n *\n * @param schema - The schema against which to validate the form data\n * @param formData - The form data to validate\n * @param rootSchema - The root schema used to provide $ref resolutions\n * @returns - true if the formData validates against the schema, false otherwise\n * @throws - Error when the schema provided does not match the base schema of the precompiled validator OR if there\n * isn't a precompiled validator function associated with the schema\n */\n isValid(schema: S, formData: T | undefined, rootSchema: S) {\n this.ensureSameRootSchema(rootSchema, formData);\n if (get(schema, ID_KEY) === JUNK_OPTION_ID) {\n return false;\n }\n const validator = this.getValidator(schema);\n return validator(formData);\n }\n}\n", "import type { FormContextType, RJSFSchema, StrictRJSFSchema, ValidatorType } from '@rjsf/utils';\n\nimport AJV8PrecompiledValidator from './precompiledValidator';\nimport type { Localizer, SuppressDuplicateFilteringType, ValidatorFunctions } from './types';\n\n/** Creates and returns a `ValidatorType` interface that is implemented with a precompiled validator. If a `localizer`\n * is provided, it is used to translate the messages generated by the underlying AJV validation.\n *\n * NOTE: The `validateFns` parameter is an object obtained by importing from a precompiled validation file created via\n * the `compileSchemaValidators()` function.\n *\n * @param validateFns - The map of the validation functions that are created by the `compileSchemaValidators()` function\n * @param rootSchema - The root schema that was used with the `compileSchemaValidators()` function\n * @param [localizer] - If provided, is used to localize a list of Ajv `ErrorObject`s\n * @param [suppressDuplicateFiltering] - Controls which duplicate filtering is suppressed; see `filterDuplicateErrors`\n * @returns - The precompiled validator implementation resulting from the set of parameters provided\n */\nexport default function createPrecompiledValidator<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(\n validateFns: ValidatorFunctions,\n rootSchema: S,\n localizer?: Localizer,\n suppressDuplicateFiltering?: SuppressDuplicateFilteringType,\n): ValidatorType<T, S, F> {\n return new AJV8PrecompiledValidator<T, S, F>(validateFns, rootSchema, localizer, suppressDuplicateFiltering);\n}\n", "import { RJSF_ADDITIONAL_PROPERTIES_FLAG } from '@rjsf/utils';\nimport type { Options } from 'ajv';\nimport Ajv from 'ajv';\nimport type { FormatsPluginOptions } from 'ajv-formats';\nimport addFormats from 'ajv-formats';\nimport isObject from 'lodash/isObject';\n\nimport type { CustomValidatorOptionsType } from './types';\n\nexport const AJV_CONFIG: Options = {\n allErrors: true,\n multipleOfPrecision: 8,\n strict: false,\n verbose: true,\n discriminator: false, // TODO enable this in V6\n} as const;\nexport const COLOR_FORMAT_REGEX =\n /^(#?([0-9A-Fa-f]{3}){1,2}\\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\\(\\s*\\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\b\\s*,\\s*\\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\b\\s*,\\s*\\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\b\\s*\\))|(rgb\\(\\s*(\\d?\\d%|100%)+\\s*,\\s*(\\d?\\d%|100%)+\\s*,\\s*(\\d?\\d%|100%)+\\s*\\)))$/;\nexport const DATA_URL_FORMAT_REGEX = /^data:([a-z]+\\/[a-z0-9-+.]+)?;(?:name=(.*);)?base64,(.*)$/;\n\n/** Creates an Ajv version 8 implementation object with standard support for the 'color` and `data-url` custom formats.\n * If `additionalMetaSchemas` are provided then the Ajv instance is modified to add each of the meta schemas in the\n * list. If `customFormats` are provided then those additional formats are added to the list of supported formats. If\n * `ajvOptionsOverrides` are provided then they are spread on top of the default `AJV_CONFIG` options when constructing\n * the `Ajv` instance. With Ajv v8, the JSON Schema formats are not provided by default, but can be plugged in. By\n * default, all formats from the `ajv-formats` library are added. To disable this capability, set the `ajvFormatOptions`\n * parameter to `false`. Additionally, you can configure the `ajv-formats` by providing a custom set of\n * [format options](https://github.com/ajv-validator/ajv-formats) to the `ajvFormatOptions` parameter.\n *\n * @param [additionalMetaSchemas] - The list of additional meta schemas that the validator can access\n * @param [customFormats] - The set of additional custom formats that the validator will support\n * @param [ajvOptionsOverrides={}] - The set of validator config override options\n * @param [ajvFormatOptions] - The `ajv-format` options to use when adding formats to `ajv`; pass `false` to disable it\n * @param [AjvClass] - The `Ajv` class to use when creating the validator instance\n * @param [extenderFn] - A function to call to extend AJV, such as `ajvErrors()`\n */\nexport default function createAjvInstance(\n additionalMetaSchemas?: CustomValidatorOptionsType['additionalMetaSchemas'],\n customFormats?: CustomValidatorOptionsType['customFormats'],\n ajvOptionsOverrides: CustomValidatorOptionsType['ajvOptionsOverrides'] = {},\n ajvFormatOptions?: FormatsPluginOptions | false,\n AjvClass: typeof Ajv = Ajv,\n extenderFn?: CustomValidatorOptionsType['extenderFn'],\n) {\n let ajv = new AjvClass({ ...AJV_CONFIG, ...ajvOptionsOverrides });\n if (ajvFormatOptions) {\n addFormats(ajv, ajvFormatOptions);\n } else if (ajvFormatOptions !== false) {\n addFormats(ajv);\n }\n\n // add custom formats\n ajv.addFormat('data-url', DATA_URL_FORMAT_REGEX);\n ajv.addFormat('color', COLOR_FORMAT_REGEX);\n\n // Register the remaining string-keyed RJSF property so AJV strict mode doesn't reject it.\n // ADDITIONAL_PROPERTY_FLAG, RJSF_REF_KEY, and RJSF_REF_CYCLE_KEY are now Symbols and\n // invisible to AJV, so they no longer need to be registered as keywords.\n ajv.addKeyword(RJSF_ADDITIONAL_PROPERTIES_FLAG);\n\n // add more schemas to validate against\n if (Array.isArray(additionalMetaSchemas)) {\n ajv.addMetaSchema(additionalMetaSchemas);\n }\n\n // add more custom formats to validate against\n if (isObject(customFormats)) {\n Object.keys(customFormats).forEach((formatName) => {\n ajv.addFormat(formatName, customFormats[formatName]);\n });\n }\n if (extenderFn) {\n ajv = extenderFn(ajv);\n }\n\n return ajv;\n}\n", "import type {\n CustomValidator,\n ErrorTransformer,\n FormContextType,\n RJSFSchema,\n StrictRJSFSchema,\n UiSchema,\n ValidationData,\n ValidatorType,\n} from '@rjsf/utils';\nimport { deepEquals, ID_KEY, ROOT_SCHEMA_PREFIX, withIdRefPrefix, hashForSchema } from '@rjsf/utils';\nimport type { ErrorObject, ValidateFunction } from 'ajv';\nimport type Ajv from 'ajv';\n\nimport createAjvInstance from './createAjvInstance';\nimport type { RawValidationErrorsType } from './processRawValidationErrors';\nimport processRawValidationErrors from './processRawValidationErrors';\nimport type { CustomValidatorOptionsType, Localizer, SuppressDuplicateFilteringType } from './types';\n\n/** `ValidatorType` implementation that uses the AJV 8 validation mechanism.\n */\nexport default class AJV8Validator<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n> implements ValidatorType<T, S, F> {\n /** The AJV instance to use for all validations\n *\n * @private\n */\n ajv: Ajv;\n\n /** The Localizer function to use for localizing Ajv errors\n *\n * @private\n */\n readonly localizer?: Localizer;\n\n /** Controls which duplicate error filtering is suppressed; see `filterDuplicateErrors`\n *\n * @private\n */\n readonly suppressDuplicateFiltering?: SuppressDuplicateFilteringType;\n\n /** Most recent `rootSchema` reference processed by `handleSchemaUpdate`.\n *\n * @private\n */\n private lastSeenRootSchema?: S;\n\n /** True once a `rootSchema` has been registered with Ajv in this lifecycle.\n *\n * @private\n */\n private hasRegisteredRootSchema = false;\n\n /** Constructs an `AJV8Validator` instance using the `options`\n *\n * @param options - The `CustomValidatorOptionsType` options that are used to create the AJV instance\n * @param [localizer] - If provided, is used to localize a list of Ajv `ErrorObject`s\n */\n constructor(options: CustomValidatorOptionsType, localizer?: Localizer) {\n const {\n additionalMetaSchemas,\n customFormats,\n ajvOptionsOverrides,\n ajvFormatOptions,\n AjvClass,\n extenderFn,\n suppressDuplicateFiltering,\n } = options;\n this.ajv = createAjvInstance(\n additionalMetaSchemas,\n customFormats,\n ajvOptionsOverrides,\n ajvFormatOptions,\n AjvClass,\n extenderFn,\n );\n this.localizer = localizer;\n this.suppressDuplicateFiltering = suppressDuplicateFiltering;\n }\n\n /** Resets the internal AJV validator to clear schemas from it. Can be helpful for resetting the validator for tests.\n */\n reset() {\n this.ajv.removeSchema();\n this.lastSeenRootSchema = undefined;\n this.hasRegisteredRootSchema = false;\n }\n\n /** Runs the pure validation of the `schema` and `formData` without any of the RJSF functionality. Provided for use\n * by the playground. Returns the `errors` from the validation\n *\n * @param schema - The schema against which to validate the form data * @param schema\n * @param formData - The form data to validate\n */\n rawValidation<Result = any>(schema: S, formData?: T): RawValidationErrorsType<Result> {\n let compilationError: Error | undefined = undefined;\n let compiledValidator: ValidateFunction | undefined;\n try {\n if (schema[ID_KEY]) {\n compiledValidator = this.ajv.getSchema(schema[ID_KEY]);\n }\n if (compiledValidator === undefined) {\n compiledValidator = this.ajv.compile(schema);\n }\n compiledValidator(formData);\n } catch (err) {\n compilationError = err as Error;\n // AJV registers a schema in its internal cache before running meta-schema\n // validation. When that check throws, the broken schema stays cached so\n // subsequent compile() calls skip revalidation and return silently. Remove\n // the entry so every call with an invalid schema consistently produces a\n // compilation error. For schemas with $id the cache key is the id string;\n // for anonymous schemas AJV uses the object reference as the key.\n // Guard with compiledValidator === undefined so that a runtime error thrown\n // by compiledValidator(formData) does not evict a correctly-compiled schema.\n if (compiledValidator === undefined) {\n this.ajv.removeSchema(schema[ID_KEY] !== undefined ? schema[ID_KEY] : (schema as object));\n }\n }\n\n let errors;\n if (compiledValidator) {\n if (typeof this.localizer === 'function') {\n // Properties need to be enclosed with quotes so that\n // `AJV8Validator#transformRJSFValidationErrors` replaces property names\n // with `title` or `ui:title`. See #4348, #4349, #4387, and #4402.\n (compiledValidator.errors ?? []).forEach((error) => {\n ['missingProperty', 'property'].forEach((key) => {\n if (error.params?.[key]) {\n // oxlint-disable-next-line no-param-reassign\n error.params[key] = `'${error.params[key]}'`;\n }\n });\n if (error.params?.deps) {\n // As `error.params.deps` is the comma+space separated list of missing dependencies, enclose each dependency separately.\n // For example, `A, B` is converted into `'A', 'B'`.\n // oxlint-disable-next-line no-param-reassign\n error.params.deps = error.params.deps\n .split(', ')\n .map((v: string) => `'${v}'`)\n .join(', ');\n }\n });\n this.localizer(compiledValidator.errors);\n // Revert to originals\n (compiledValidator.errors ?? []).forEach((error) => {\n ['missingProperty', 'property'].forEach((key) => {\n if (error.params?.[key]) {\n // oxlint-disable-next-line no-param-reassign\n error.params[key] = error.params[key].slice(1, -1);\n }\n });\n if (error.params?.deps) {\n // Remove surrounding quotes from each missing dependency. For example, `'A', 'B'` is reverted to `A, B`.\n // oxlint-disable-next-line no-param-reassign\n error.params.deps = error.params.deps\n .split(', ')\n .map((v: string) => v.slice(1, -1))\n .join(', ');\n }\n });\n }\n errors = compiledValidator.errors || undefined;\n\n // Clear errors to prevent persistent errors, see #1104\n compiledValidator.errors = null;\n }\n\n return {\n errors: errors as unknown as Result[],\n validationError: compilationError,\n };\n }\n\n /** This function processes the `formData` with an optional user contributed `customValidate` function, which receives\n * the form data and a `errorHandler` function that will be used to add custom validation errors for each field. Also\n * supports a `transformErrors` function that will take the raw AJV validation errors, prior to custom validation and\n * transform them in what ever way it chooses.\n *\n * @param formData - The form data to validate\n * @param schema - The schema against which to validate the form data\n * @param [customValidate] - An optional function that is used to perform custom validation\n * @param [transformErrors] - An optional function that is used to transform errors after AJV validation\n * @param [uiSchema] - An optional uiSchema that is passed to `transformErrors` and `customValidate`\n */\n validateFormData(\n formData: T | undefined,\n schema: S,\n customValidate?: CustomValidator<T, S, F>,\n transformErrors?: ErrorTransformer<T, S, F>,\n uiSchema?: UiSchema<T, S, F>,\n ): ValidationData<T> {\n const rawErrors = this.rawValidation<ErrorObject>(schema, formData);\n return processRawValidationErrors(\n this,\n rawErrors,\n formData,\n schema,\n customValidate,\n transformErrors,\n uiSchema,\n this.suppressDuplicateFiltering,\n );\n }\n\n /**\n * This function checks if a schema needs to be added and if the root schemas don't match it removes the old root schema from the ajv instance and adds the new one.\n * When called repeatedly with the same `rootSchema` reference the deep-equality check is skipped.\n *\n * @param rootSchema - The root schema used to provide $ref resolutions\n */\n handleSchemaUpdate(rootSchema: S): void {\n if (this.lastSeenRootSchema === rootSchema && this.hasRegisteredRootSchema) {\n return;\n }\n const rootSchemaId = rootSchema[ID_KEY] ?? ROOT_SCHEMA_PREFIX;\n // add the rootSchema ROOT_SCHEMA_PREFIX as id.\n // if schema validator instance doesn't exist, add it.\n // else if the root schemas don't match, we should remove and add the root schema so we don't have to remove and recompile the schema every run.\n if (this.ajv.getSchema(rootSchemaId) === undefined) {\n this.ajv.addSchema(rootSchema, rootSchemaId);\n } else if (!deepEquals(rootSchema, this.ajv.getSchema(rootSchemaId)?.schema)) {\n this.ajv.removeSchema(rootSchemaId);\n this.ajv.addSchema(rootSchema, rootSchemaId);\n }\n this.lastSeenRootSchema = rootSchema;\n this.hasRegisteredRootSchema = true;\n }\n\n /** Validates data against a schema, returning true if the data is valid, or\n * false otherwise. If the schema is invalid, then this function will return\n * false.\n *\n * @param schema - The schema against which to validate the form data\n * @param formData - The form data to validate\n * @param rootSchema - The root schema used to provide $ref resolutions\n */\n isValid(schema: S, formData: T | undefined, rootSchema: S) {\n // schemaId and compiled are declared outside the try so the catch block can\n // conditionally remove the broken schema from AJV's registry.\n let schemaId: string | undefined;\n let compiled = false;\n try {\n this.handleSchemaUpdate(rootSchema);\n // then rewrite the schema ref's to point to the rootSchema\n // this accounts for the case where schema have references to models\n // that lives in the rootSchema but not in the schema in question.\n const schemaWithIdRefPrefix = withIdRefPrefix<S>(schema) as S;\n schemaId = schemaWithIdRefPrefix[ID_KEY] ?? hashForSchema(schemaWithIdRefPrefix);\n let compiledValidator: ValidateFunction | undefined;\n compiledValidator = this.ajv.getSchema(schemaId);\n if (compiledValidator === undefined) {\n // Add schema by an explicit ID so it can be fetched later\n // Fall back to using compile if necessary\n // https://ajv.js.org/guide/managing-schemas.html#pre-adding-all-schemas-vs-adding-on-demand\n compiledValidator =\n this.ajv.addSchema(schemaWithIdRefPrefix, schemaId).getSchema(schemaId) ||\n this.ajv.compile(schemaWithIdRefPrefix);\n }\n compiled = true;\n const result = compiledValidator(formData);\n return result;\n } catch (e) {\n // oxlint-disable-next-line no-console\n console.warn('Error encountered compiling schema:', e);\n // Remove the broken schema from AJV's registry so a subsequent rawValidation\n // or isValid call does not silently reuse a cached entry that bypassed\n // meta-schema validation. Guard with !compiled so that a runtime error thrown\n // by compiledValidator(formData) does not evict a correctly-compiled schema.\n if (!compiled && schemaId !== undefined) {\n this.ajv.removeSchema(schemaId);\n }\n return false;\n }\n }\n}\n", "import type { FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';\n\nimport type { CustomValidatorOptionsType, Localizer } from './types';\nimport AJV8Validator from './validator';\n\n/** Creates and returns a customized implementation of the `ValidatorType` with the given customization `options` if\n * provided. If a `localizer` is provided, it is used to translate the messages generated by the underlying AJV\n * validation.\n *\n * @param [options={}] - The `CustomValidatorOptionsType` options that are used to create the `ValidatorType` instance\n * @param [localizer] - If provided, is used to localize a list of Ajv `ErrorObject`s\n * @returns - The custom validator implementation resulting from the set of parameters provided\n */\nexport default function customizeValidator<\n T = any,\n S extends StrictRJSFSchema = RJSFSchema,\n F extends FormContextType = any,\n>(options: CustomValidatorOptionsType = {}, localizer?: Localizer) {\n return new AJV8Validator<T, S, F>(options, localizer);\n}\n", "import createPrecompiledValidator from './createPrecompiledValidator';\nimport customizeValidator from './customizeValidator';\n\nexport { customizeValidator, createPrecompiledValidator };\nexport type * from './types';\n\nexport default customizeValidator();\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;AAAA;AAAA,+EAAAA,UAAAC,SAAA;AAAA;AAGA,QAAM,S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AK,qBAAqB;AAC1B,SAAK,0BAA0B;EACjC;;;;;;;;;EAUA,QAAQ,QAAW,UAAyB,YAAa;;AAGvD,QAAI;AACJ,QAAI,WAAW;AACf,QAAI;AACF,WAAK,mBAAmB,UAAU;AAIlC,YAAM,wBAAwB,gBAAmB,MAAM;AACvD,kBAAW,KAAA,sBAAsB,MAAM,OAAC,QAAA,OAAA,SAAA,KAAI,cAAc,qBAAqB;AAC/E,UAAI;AACJ,0BAAoB,KAAK,IAAI,UAAU,QAAQ;AAC/C,UAAI,sBAAsB,QAAW;AAInC,4BACE,KAAK,IAAI,UAAU,uBAAuB,QAAQ,EAAE,UAAU,QAAQ,KACtE,KAAK,IAAI,QAAQ,qBAAqB;MAC1C;AACA,iBAAW;AACX,YAAM,SAAS,kBAAkB,QAAQ;AACzC,aAAO;IACT,SAAS,GAAG;AAEV,cAAQ,KAAK,uCAAuC,CAAC;AAKrD,UAAI,CAAC,YAAY,aAAa,QAAW;AACvC,aAAK,IAAI,aAAa,QAAQ;MAChC;AACA,aAAO;IACT;EACF;;;;ACxQY,SAAP,mBAIL,UAAsC,CAAA,GAAI,WAAqB;AAC/D,SAAO,IAAI,cAAuB,SAAS,SAAS;AACtD;;;ACbA,IAAA,cAAe,mBAAkB;",
|
|
6
|
+
"names": ["exports", "module", "exports", "module", "exports", "module", "exports", "get", "set", "exports", "exports", "module", "exports", "UsedValueState", "exports", "parent", "property", "exports", "constant", "exports", "self", "Type", "isNumber", "exports", "exports", "exports", "exports", "self", "exports", "DataType", "exports", "exports", "exports", "property", "exports", "_a", "self", "exports", "exports", "module", "keys", "exports", "module", "exports", "exports", "self", "exports", "exports", "exports", "root", "resolveSchema", "exports", "module", "require_utils", "exports", "module", "require_schemes", "exports", "module", "require_fast_uri", "exports", "module", "exports", "exports", "Ajv", "root", "exports", "self", "root", "exports", "exports", "exports", "exports", "exports", "exports", "exports", "exports", "exports", "exports", "exports", "exports", "exports", "exports", "exports", "exports", "exports", "exports", "exports", "exports", "exports", "property", "exports", "exports", "exports", "exports", "exports", "exports", "exports", "exports", "exports", "exports", "exports", "self", "exports", "exports", "exports", "exports", "DiscrError", "exports", "exports", "exports", "module", "Ajv", "exports", "module", "exports", "exports", "self", "addFormats", "module", "exports", "Symbol", "objectProto", "nativeObjectToString", "symToStringTag", "transform", "objectProto", "hasOwnProperty", "isObject", "funcProto", "funcToString", "funcProto", "objectProto", "funcToString", "hasOwnProperty", "objectProto", "hasOwnProperty", "objectProto", "hasOwnProperty", "HASH_UNDEFINED", "Map", "INFINITY", "hasOwnProperty", "property", "sameValueEqual", "property", "toString", "areArraysEqual", "areDatesEqual", "areMapsEqual", "areObjectsEqual", "areRegExpsEqual", "areSetsEqual", "areArrayBuffersEqual", "areDataViewsEqual", "areErrorsEqual", "arePrimitiveWrappersEqual", "areTypedArraysEqual", "areUrlsEqual", "objectProto", "objectProto", "hasOwnProperty", "Promise", "Set", "WeakMap", "objectTag", "objectProto", "hasOwnProperty", "argsTag", "funcTag", "mapTag", "objectTag", "setTag", "weakMapTag", "dataViewTag", "freeExports", "freeModule", "moduleExports", "mapTag", "setTag", "objectProto", "hasOwnProperty", "objectProto", "hasOwnProperty", "MAX_SAFE_INTEGER", "objectProto", "hasOwnProperty", "keys", "objectProto", "hasOwnProperty", "freeExports", "freeModule", "moduleExports", "Buffer", "objectProto", "propertyIsEnumerable", "nativeGetSymbols", "objectProto", "hasOwnProperty", "Uint8Array", "symbolProto", "boolTag", "dateTag", "mapTag", "numberTag", "regexpTag", "setTag", "stringTag", "symbolTag", "arrayBufferTag", "dataViewTag", "float32Tag", "float64Tag", "int8Tag", "int16Tag", "int32Tag", "uint8Tag", "uint8ClampedTag", "uint16Tag", "uint32Tag", "mapTag", "setTag", "argsTag", "arrayTag", "boolTag", "dateTag", "errorTag", "funcTag", "genTag", "mapTag", "numberTag", "objectTag", "regexpTag", "setTag", "stringTag", "symbolTag", "weakMapTag", "arrayBufferTag", "dataViewTag", "float32Tag", "float64Tag", "int8Tag", "int16Tag", "int32Tag", "uint8Tag", "uint8ClampedTag", "uint16Tag", "uint32Tag", "key", "objectProto", "hasOwnProperty", "transform", "CLONE_DEEP_FLAG", "CLONE_FLAT_FLAG", "CLONE_SYMBOLS_FLAG", "UriResolver", "jsonpointer", "objectProto", "hasOwnProperty", "stringTag", "INFINITY", "INFINITY", "MAX_SAFE_INTEGER", "HASH_UNDEFINED", "othValue", "set", "COMPARE_PARTIAL_FLAG", "COMPARE_UNORDERED_FLAG", "boolTag", "dateTag", "errorTag", "mapTag", "numberTag", "regexpTag", "setTag", "stringTag", "symbolTag", "arrayBufferTag", "dataViewTag", "symbolProto", "symbolValueOf", "COMPARE_PARTIAL_FLAG", "objectProto", "hasOwnProperty", "COMPARE_PARTIAL_FLAG", "argsTag", "arrayTag", "objectTag", "objectProto", "hasOwnProperty", "COMPARE_PARTIAL_FLAG", "COMPARE_UNORDERED_FLAG", "COMPARE_PARTIAL_FLAG", "COMPARE_UNORDERED_FLAG", "object", "INFINITY", "LARGE_ARRAY_SIZE", "set", "numberTag", "union", "d", "memoize", "isEmpty", "compareSchemaDefinitions", "compareSchemaValues", "identity", "merge", "keys", "check", "identity", "mergeArrayOfSchemaDefinitions", "assigners", "checks", "l", "intersection", "union", "mergeArrayOfSchemaDefinitions", "collection", "AdditionalItemsHandling", "keys", "omit", "_a", "keys", "property", "index", "isEmpty", "CLONE_DEEP_FLAG", "CLONE_SYMBOLS_FLAG", "hasPath", "LARGE_ARRAY_SIZE", "_jsx", "ReactIs", "_jsx", "props", "state", "property", "property", "import_react", "_jsx", "property", "import_react", "import_react", "TranslatableString", "property", "Ajv", "addFormats", "_a"]
|
|
7
|
+
}
|